Chat 2 by Siropu

Chat 2 by Siropu [Paid] 2.3.5

No permission to buy (€29.99)
Another feature that would be great to have Minimum time between messages for each Room separately as I would like to have for example 2-3 rooms where one of the rooms will have 5 minutes or maybe more limit compared to other rooms where I will have 5-10 seconds limit.
I will add that in the next release.

@katsulynx, that's because the editor gets disabled when using that option.
 
@katsulynx, that's because the editor gets disabled when using that option.

Would be cool if at least the extra submit button would still work though. I understand, that hitting enter while the editor is disabled, might be troublesome to check (although not impossible), but the submit button should either be hidden on disabling BB Codes or still submit (the latter obviously preferred).
 
Make sure that you haven't set "Prune messages" to "Never" for other groups that you are in.
If that's not the problem, go to ACP > Chat > Commands > prune and set the user groups there too.
 
Is it possible to stop media tags from automatically converting links to media in the chat itself? ie: if someone posts a YT link it converts automatically to a video, same with reddit, twitter, etc. (I openly admit I'm using the s9e Media Sites add-on for the rest of my site, this is where it stems from, but I'm talking about the automatic parsing/conversion of the links to media). Can this be stopped within the chat?

(I do have the Media BBCode disabled in the chat options, it does not stop it happening)

This appears to be because of the way the BBCode parser restructures the message, a trivial disable doesn't seem to work.

If you find:
PHP:
public function prepare($message)
        {
                $this->message = $this->processMessage($message);

in Service/Message/Preparer.php and add

PHP:
          $this->message = preg_replace('`\[media(=[^\]]*)?\][^\[]*\[\/media\]`i','',$this->message);

after, it will stop the main embed code. It is a bit hacky, and if you want it to look better you'd also strip the extra formatting the media tag triggers if you see this.
 
Some suggestions

1) Could we get the ability to set the default room on chat load?

2) Could we get the ability to simply assign rooms based on usergroup rather than have join/leave options?

3) The room selection UI needs needs a facelift badly.
 
1. This is already possible with the "Default joined rooms" option.
2. "Default joined rooms" option takes into consideration room permissions so you can create a room for each user group you want and select them all.
3. How so?
 
1) No it isn't. It picks a room from the ones you select. You don't pick the actual room people are in on page load. Not as an admin and not as a member as far as I could tell. It doesn't even remember your last room.

2) That isn't what I am referring to. I don't want any join/leave options. Just "Member is part of this usergroup means they're in this room". The end.

I will either be bridging this or Blueimp's AJAX chat with the site's Discord server, and the goal is to have full sync between channels. Having the join/leave option at all just confuses things.

3) Tabs, or some other meaningful visual distinction between one room and its number of users and the next. If you like I can whip up some template edits.

Anyway, more issues:

4) By far, the most common complaint right now is people not being able to disable the chat from the chat tab. Since the option isn't there a lot of my members are confused. A more elegant option would be to control whether it appears anywhere else on site.

5) Your chat sends an immense amount of what seems to be presence data. I rolled this out and suddenly a hundred and fifty people were having less fun on my site. To be clear, Blueimp's chat handles this far more gracefully, so I expected yours would to. You don't seem to distinguish between doing a full poll for everything and just the bare minimum as far as I can tell.

6) The popup window isn't scrolling on chat updates.
 
1. What "Default joined room" does, it automatically joins you in a room when you first use the chat.

It doesn't even remember your last room.
Actually, it is designed to display the last room/conversation you last viewed. I did have notice an issue with this but it is very strange as it can happen suddenly at some point by not saving cookies anymore. If you encounter this, please try to log out of XF and then log in back to see that.

2. Not possible.
3. If you can come up with a better room list, let us see it please.
4. What do you mean by "Chat tab"? You can disable chat from the chat user settings.
5. Not sure I understand what you mean. The chat loads what needs to be loaded.
6. Seems to be due to the content height auto-adjustment. Will make some changes in the next release.
 
1) I see. XenForo's setCookie function defaults to httponly = true, so when your addon sets the cookie through php first:

Code:
grep -r setCookie *
Pub/Controller/Room.php:          $this->app()->response()->setCookie('siropu_chat_room_id', $room->room_id);
Pub/Controller/Archive.php:               $this->app()->response()->setCookie('siropu_chat_archive_order', $setOrder);
Pub/Controller/Conversation.php:          $this->app()->response()->setCookie('siropu_chat_channel', 'conv');
Pub/Controller/Conversation.php:          $this->app()->response()->setCookie('siropu_chat_conv_id', $params->conversation_id);
Repository/User.php:                         \XF::app()->response()->setCookie('siropu_chat_channel', 'room');
Repository/User.php:                         \XF::app()->response()->setCookie('siropu_chat_room_id', $forceRoom);
XF/Entity/User.php:               $this->app()->response()->setCookie('siropu_chat_channel', 'room');
XF/Entity/User.php:               $this->app()->response()->setCookie('siropu_chat_room_id', $roomId);
XF/Entity/User.php:          $this->app()->response()->setCookie('siropu_chat_room_id', false);

...it won't be able to be modified using javascript code.

2) Either you're not interested in providing the feature or don't see a clear path in doing so. I can grab a decade-old open source chat and do just this.

I could also modify your code to do so but it is non-trivial and I would have to put up with merge conflicts when you update.

3) Sure:
Less:
#siropuChatTabs
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    .xf-siropuChatTabsContainer();

    a
    {
        .xf-siropuChatTabsItem();
        border: 1px solid @xf-borderColorFeature;
        border-top: 0;
        border-radius: 0 0 @xf-borderRadiusMedium @xf-borderRadiusMedium;
        margin: 0;
        padding: @xf-paddingSmall;

        &:hover
        {
            .xf-siropuChatTabsItemHover();
        }
        &.siropuChatActiveTab
        {
            .xf-siropuChatTabsItemActive();
            color: @xf-textColorAccentContent;
            border-color: @xf-textColorAccentContent;
            background-color: @xf-contentAccentBg;
        }
        > span
        {
            .xf-siropuChatTabsItemBadge();
            border-radius: @xf-borderRadiusMedium;

            &.siropuChatTabCountActive
            {
                background: @xf-siropuChatActiveUserCountBadgeColor;
                color: @xf-siropuChatActiveUserCountColor;
            }
            &.siropuChatTabCountInactive
            {
                background: @xf-siropuChatNoUserCountBadgeColor;
                color: @xf-siropuChatNoUserCountColor;
            }
        }
    }
    > span
    {
        margin-left: auto;
    }
}

I take no responsibility for the individual colors chosen.

4) The dedicated chat page. The option to disable isn't present there.

5) Yeah no.
siropu1.webp
siropu2.webp

You're sending duplicate presence data in successive requests. You're sending presence data for rooms people aren't currently in. You're sending presence data as full html blocks. You're sending duplicated information in individual presence responses. You're even sending this full presence data when the widget window is closed, (like when you set it to 'all' and close it at the bottom) because your addon doesn't distinguish between requesting the minimum information possible and absolutely everything.

You're also making these requests via POST. There are configurations where php ends up processing POST requests rather differently and it locks all child processes. I imagine at least one person installed your addon and just figured their server wasn't capable of handling it.
 
1. Interesting. Will look into that.
2. Implementing this won't be a problem, as long as more users are requesting this feature.
3. I thought you were referring to room list, not tabs. The change doesn't look good to me, to be honest. The reason I designed the tabs the way they are is to make it look more clean and simple. I have added style properties so that admins can make it how they want.
4. It is by design as I don't see the point of disabling chat on the dedicated page since you can just leave the page.

You're sending duplicate presence data in successive requests.
I think I have mentioned this before but I plan to add an option to request user list every x seconds, rather than on every request.

You're sending presence data for rooms people aren't currently in.
This is by design. It updates all rooms you have joined, not just the one you are viewing.

You're sending presence data as full html blocks.
That's because this is a 100% XF add-on and uses XF methods and menus. I think this can be improved by retrieving only minimal data and get full list if new users have joined. I will play with this soon.

You're sending duplicated information in individual presence responses.
I don't understand what you mean by this.

You're even sending this full presence data when the widget window is closed,
Yes, but once closed, refresh interval resets to 60 seconds.

You're also making these requests via POST.
You are right. I've set it to GET for the next release as it makes more sense.
 
2) A better response than 'impossible' at least.

My method would be, when the admin preference is set, swap out looking at preferences for joined rooms and just pull what rooms their usergroups have access to, and then hide the join/leave button. It's not like the client is controlling joinedRooms in the response, there.

3) At the very least you can change the colors on the current active tab to a highlight. Could highlight the join/leave button also.

4) It is not a good design, as my users were panicking to figure out how to disable it.

The option should toggle the widget's visibility. If they're on the chat page, they probably want to be there.

4a)
I think I have mentioned this before but I plan to add an option to request user list every x seconds, rather than on every request.

Or you could use a timestamp to note whether or not presence data even needs to be sent. Presence data is expensive.

4b)
This is by design. It updates all rooms you have joined, not just the one you are viewing.

Presence data is expensive. Especially when polling, you need to consider if it is appropriate to send it at all.

4c)
That's because this is a 100% XF add-on and uses XF methods and menus. I think this can be improved by retrieving only minimal data and get full list if new users have joined. I will play with this soon.

Awesome.

4d)
I don't understand what you mean by this.

Won't be an issue if you resolve the above, but the user id gets sent twice.

4e)
Yes, but once closed, refresh interval resets to 60 seconds.

Again, presence data is expensive. It doesn't even get seen by e.g. mobile users.

You should really be requesting room presence data as a different sort of update request, or a modification to your standard poll. Is the userlist actually visible to the user? Then ask for it by room. If not, don't ask for it.
 
Few things I wanted to bring up:
  1. The submit button covers up input text. Especially annoying on small screens.
  2. The private conversations notification never updates? It just says "0" all the time. EDIT: It works if the page is open at the time the message is received, otherwise there's no indication of a new message.
  3. I may have missed the setting somewhere, but there doesn't seem to be private conversations new message alert unless you're already looking at the chat page (the "private conversations" blinking text)
 
Last edited:
The submit button covers up input text.
I have made a change so that on mobile devices, the button will display only the icon.

The private conversations notification never updates?
That is not for notifications, it is the number of contacts that are currently online. Is the same for room tabs, it displays the number of active chatters.

there doesn't seem to be private conversations new message alert
There aren't currently because I believe it can impact performance having to do a few extra queries on each post. I can add it as an option though.
 
I didn't see it in the description but is there any chat logging features available? Both public and private? We had problems with abuse in years past in our live chat rooms and needed detailed logs to go back and sort out the situations.
 
board breaking bug in this, 4k+ errors within 2 minutes of installing.
Code:
Error: Class 'Siropu\AdsManager\Util\Arr' not found src/addons/Siropu/Chat/Repository/User.php:117
Generated by: Darth Whisky Jun 16, 2018 at 12:45 PM
Stack trace
#0 src/addons/Siropu/Chat/Pub/View/Chat.php(35): Siropu\Chat\Repository\User->getUsersData(Array, 1)
#1 src/XF/Mvc/Renderer/AbstractRenderer.php(77): Siropu\Chat\Pub\View\Chat->renderJson()
#2 src/XF/Mvc/Renderer/Json.php(60): XF\Mvc\Renderer\AbstractRenderer->renderViewObject('Siropu\\Chat:Cha...', '', Array)
#3 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Json->renderView('Siropu\\Chat:Cha...', '', Array)
#4 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#5 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'json')
#6 src/XF/App.php(1891): XF\Mvc\Dispatcher->run()
#7 src/XF.php(328): XF\App->run()
#8 index.php(13): XF::runApp('XF\\Pub\\App')
#9 {main}
Request state
array(4) {
  ["url"] => string(625) "/xenforo/index.php?chat/update&channel=room&users%5B1%5D=2151%2C241%2C1844%2C4353%2C6323%2C6145%2C5827%2C5826%2C2486%2C6761%2C820%2C1759%2C4879%2C3656%2C6937%2C6381%2C6115%2C7022%2C5590%2C6838%2C4790%2C4941%2C6489%2C1%2C1789%2C4381%2C6190%2C1864%2C208%2C3336%2C4383%2C1230%2C30%2C3042%2C7008%2C457%2C2396&room_id=1&last_id%5B1%5D=368&conv_id=0&conv_only=0&conv_items=&conv_last_active=1529171079&conv_last_update=1529171079&user_last_update=1529171079&is_chat_page=0&_xfRequestUri=%2Fxenforo%2Fresources%2Fpriority-placement-tool.38%2F&_xfWithData=1&_xfToken=1529171079%2Ce4c34084e9c0157ad2179d7850911bb3&_xfResponseType=json"
  ["referrer"] => string(72) "https://pointsixtyfive.com/xenforo/resources/priority-placement-tool.38/"
  ["_GET"] => array(16) {
    ["chat/update"] => string(0) ""
    ["channel"] => string(4) "room"
    ["users"] => array(1) {
      [1] => string(175) "2151,241,1844,4353,6323,6145,5827,5826,2486,6761,820,1759,4879,3656,6937,6381,6115,7022,5590,6838,4790,4941,6489,1,1789,4381,6190,1864,208,3336,4383,1230,30,3042,7008,457,2396"
    }
    ["room_id"] => string(1) "1"
    ["last_id"] => array(1) {
      [1] => string(3) "368"
    }
    ["conv_id"] => string(1) "0"
    ["conv_only"] => string(1) "0"
    ["conv_items"] => string(0) ""
    ["conv_last_active"] => string(10) "1529171079"
    ["conv_last_update"] => string(10) "1529171079"
    ["user_last_update"] => string(10) "1529171079"
    ["is_chat_page"] => string(1) "0"
    ["_xfRequestUri"] => string(46) "/xenforo/resources/priority-placement-tool.38/"
    ["_xfWithData"] => string(1) "1"
    ["_xfToken"] => string(43) "1529171079,e4c34084e9c0157ad2179d7850911bb3"
    ["_xfResponseType"] => string(4) "json"
  }
  ["_POST"] => array(0) {
  }
}
 
Top Bottom