MongooseIM icon indicating copy to clipboard operation
MongooseIM copied to clipboard

Last seen of the user is returned 0 if he has recently marked himself as "unavaliable"

Open Mo33n opened this issue 7 years ago • 7 comments

MongooseIM version:2.0.1 Installed from: source Erlang/OTP version: 19

Describe the issue. "Last seen" of the user is returned 0 (which mean online) if he has recently set his status as "unavaliable".

after few mins the mod_last respond with the correct value for that user.

I have configure mod_last with mysql.

Just curious to know why is this delay happen?

Mo33n avatar Sep 14 '17 14:09 Mo33n

The MIM implementation of XEP-0012 is session based meaning that the peer in question is considered 'online' when there is a connected resource. Sending an 'unavailable' presence does not have any effect besides setting the timestamp for the 'last activity'. You need to terminate your sessions completely to be considered 'offline'. It seems your client does not do this immediately which would explain the delay.

Even though this sounds kinda wrong it is technically compliant with XEP-0012 because here 'online' means having a 'connected or available resource'. It seems for MIM the 'connected' part was chosen :).

GalaxyGorilla avatar Sep 15 '17 10:09 GalaxyGorilla

This can actually be 'fixed' by consecutively using ejabberd_sm:get_session_pid/3 and ejabberd_c2s:get_presence/1 to check the presence for each resource at this place.

GalaxyGorilla avatar Sep 15 '17 11:09 GalaxyGorilla

Thank you for clarification, Now it make sense to me.

Mo33n avatar Oct 22 '17 07:10 Mo33n

Can anyone help , is doing the change @GalaxyGorilla mentioned ? I dont have very much understanding of erlang.

Mo33n avatar Dec 11 '17 10:12 Mo33n

Anyone can help ?

Mo33n avatar Dec 20 '17 12:12 Mo33n

We'll add it to our backlog and try to improve it by 3.0 release. :)

fenek avatar Mar 19 '18 13:03 fenek

Hi @Mo33n, I'm sorry for such a long delay since our last response to you. Is this change still sth you would like to see in MongooseIM?

michalwski avatar Jan 27 '20 09:01 michalwski