MongooseIM
MongooseIM copied to clipboard
Last seen of the user is returned 0 if he has recently marked himself as "unavaliable"
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?
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 :).
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.
Thank you for clarification, Now it make sense to me.
Can anyone help , is doing the change @GalaxyGorilla mentioned ? I dont have very much understanding of erlang.
Anyone can help ?
We'll add it to our backlog and try to improve it by 3.0 release. :)
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?