I am currently using this module on a new website i created, thanks to developer. It works great.

I was wondering if the system messages (User has logged in and out) could be set to be activated only when the logged in user visits the page on which the chatblock is located;

Also, could the "info" page be put in a block so that i'll simply place the block under the chatblock message box? This way users will not need to navigate to another page to view the replacement icon smileys.

Comments

doitDave’s picture

Assigned: Unassigned » doitDave

Nice to hear that you like our module :-)

Also thanks for your suggestions. I have split these up into two issues. The first one (login/logout messages) is already on my list and thus may stay in the issue queue. It needs general review, as the informational value of users logging in or out to the site is rather little for the chat itself. Especially as most users stay logged in as long as their cookies are alive. And also, as the chatblock is not necessarily visible on each page, you never know if a user is really up to chatting.

Thus, it is most likely that I will move the binding of these messages from login/logout to some kind of status basing on a user's last poll from the chat (e.g. first poll triggers "user xy is now in the chat" and user's last poll >= poll frequency triggers "user xy is no longer chatting" or so). What do you think?

As for your second inquery, please refer to #1804272: Provide info page content also as a block.

doitDave’s picture

Version: 6.x-1.0-beta1 » 7.x-1.x-dev

Moving to 7.x

FrancoNogarin’s picture

I like your proposal David :D

doitDave’s picture

Status update: It is very likely that chatblock will gain a "currently in the chat" list function. This will make a perfect base for further informational output like "user joined/left".

doitDave’s picture

Status: Active » Postponed

Postponed until #2105853: General code refactoring is done.

doitDave’s picture

Adding some thoughts before they get lost in the wrong place.

$is_online =
 !empty($last_action)
 &&
 (
  empty($last_logout)
  ||
  (
   $last_action > $last_logout
   &&
   $last_action > REQUEST_TIME - $online_threshold
  )
 )
;

Query the users currently online (= in the chat):

SELECT u.* FROM {users} u JOIN {chatblock} c ON c.uid = u.uid WHERE 
 c.last_action IS NOT NULL 
 AND
 (
  c.last_logout IS NULL
  OR
  (
   c.last_action > c.last_logout
   AND
   c.last_action > [request_time - threshold]
  )
 )
;

Conceptual flaws so far:

  • When and how to indicate a user's status and how to handle it. Writing a "last seen" to a DB table with any(!) poll a user makes may end in a performance overkill.
  • On the other hand, there is hardly a different way.
  • And finally, what about smart poll? It is obvious that the granularity of $threshold depends 1:1 on the max smartpoll intervall (or on the standard interval if smartpoll is disabled).
doitDave’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

As I lack time for this, I will close the request. If someone likes to add some work, you're welcome with a patch and a reopening!