Chat Room triggers

Post

Posted
Rating:
#6716 (In Topic #1740)
Avatar
Standard member
Terry is in the usergroup ‘Fan in action’
Hi peeps! For the integrated Chat Room in Composr: After you join a chat room, if you change the focus from the chat room to, let's say, another browser tab, or if you look at a different app on the desktop, the chat room will consider you have left. This is probably because of the resources a chat room can use can be conserved by ignoring inactive chatters. Ideas?

So, is there a setting that would allow people to change focus from the chat room to another operation, without it timing out so soon. Maybe have a timeout of 2 minutes if the member doesn't return to the chat room focus (ala irc chat).

I'm going to try to move my website's chat room from IRC to the integrated chat. I have already made it look at bit more like irc chat, and the advantages are amazing, but I've got to nail down the timeout issue.

 
Online now: No Back to the top

Post

Posted
Rating:
#6718
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
It shouldn't be doing that.

I looked into it, and somewhat recent versions of Firefox and Chrome limit timers to a maximum resolution of 1 second when tabs are inactive.

However, that's more than the resolution the chat room runs with.

There is a limitation on the number of parallel AJAX requests in Chrome, but we're nowhere close to that either.

I just tested and it seems okay.

Try opening the Network tab of the debug tools and leave it running. Maybe you will see some failing request(s) in there, or errors in the Console tab.

Also check to see if you have any extensions that might be causing an issue, and see if it's limited to a specific web browser.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: Yes Back to the top

Post

Posted
Rating:
#6720
Avatar
Standard member
Terry is in the usergroup ‘Fan in action’


Thanks, Chris, for the information and reply!

I ran some tests with FireFox and IE. I can't see a difference. I chatted with a friend for about 45 minutes to test. Several times (but generaly rarely) the chat room said the person has left the chatroom. But, they could still type and I could see it.

This does not see to be the same as the JOINS. I mean, we don't see a bunch of JOIN messages, only PART messages.

This is a complete and total hack, as only I can do, but, is there a way to supress only the PART messages? If not, then is there a way to supress the JOINS and the PARTS?

Different browsers don't *seem" to change the equasion. Take that lightly because I don't have enough data year (chatters) to really test this. Soon I will, though. For the time being, is there a way to supress the JOINS and the PARTS?

I know this would be a hack, and I'll get down to the bottom of it soonish. We are now at over 600 members, nearly 700, with 17 a day right now. Swapping out IRC for the integrated chat is beautiful and powerful, but I have to make it work. I can flesh out the issues later.

How to supress the PART messages, if possible?

— It is the following day and I have a screenshot. Everyone is elegable to sort of ping out. Not browser specific. They call this server a business class server. It's still a shared server, though, but it's pretty fast. It's something in (probably) a JavaScript trigger mechanism?



– Another edit. Possibly a solution

define('CHAT_ACTIVITY_PRUNE', 120);

Moving it up to 2 minutes, so far, is a solution. IRC is set at 2 minutes, so it's not unreasonable. The question then is, how does it detect if someone is gone? If it's checking cookies, then what might be happening with more frequent polling, is that it's not getting an answer from the cookie on the client fast enough (lag) so it says, eh… they must have logged off. Which they didn't.. it's just the lag to get the cookie. That's my theory. Anyway, 120 might be the solution.

– edit. The timeout issue is 100% solved.
I wanto to add a :tag: that allows people to insert a YouTube URL, so that it will insert (like the pictures currently do) in the chat stream with a <video> tag. If anyone has done this already let me know. If not, if there are any hints how to do this. In any event, when I have a solution, I'll share the code here.
 

Last edit: by Terry

Online now: No Back to the top

Post

Posted
Rating:
#6730
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Composr supports blanking out the language strings of system chat messages. 'LEFT_CHATROOM' (chat.ini) in your case. If blank, the message doesn't get used.

To answer your question about how it works… it's just based on the AJAX requests regularly going on in the background. If an AJAX event happens, it updates the chat_active table. If the last timestamp for any member+room combination in that table is older than that prune constant allows, it creates the message, and removes the chat_active row. It is the PHP 'chat_room_prune' function that handles all this.

It's strange if the AJAX requests aren't happening routinely. Composr actually tries very hard to maintain the flow of these requests. It runs them every few seconds, one after the other (never in parallel). If anything (like a JS error or a request timeout) breaks the sequence, it is coded to detect that and restart sending them. Hence why I'm surprised of the issue you had.

That said, the chat code is some of the most complex in Composr.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: Yes Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

gabriel58, MVLipwig, Salman, Chris Graham, Manu, John Connor, mytracker

Forum statistics:
  • 1,216 topics, 5,711 posts, 6,874 members
  • Our newest member is DigitalMathur
Birthdays:
Back to Top