Tomasz and others,

I'm using jabberd2 v2.2.17. For a while now I have experienced strange values in the "status" database table for some users, including myself. The most obvious problem is that the status field can show "online" even if the user is offline and last-login and last-logout are both zero.

I have done some debugging and I found what is causing it. This problem occurs if the user has the server itself added to his/her roster. I am running jabberd2 on and when I add "" as Agent/Transport to my roster the problem starts occurring. I have traced the problem to mod_status handling a presence status which it should ignore, it thinks a presence message from sm itself to "" (announcing to the agent that the user is present) is mistakenly handled as a presence packet from another server.

This is what the packet looks like:
"<route xmlns='' from='sm' to=''><presence xmlns='jabber:client' to='' from=''>
<c xmlns='' ext='cs e-time ep-notify-2 html last-act mr sxe whiteboard' ver='0.15' node=''/>

This will be caught by mod_status in function _status_pkt_sm(). This function only checks whether it's a presence packet and not where it originated from. It is a presence packet and therefore the status for the user will always be set to online and the login times to zero.
I have made a quick fix by changing mod_status.c:195 :

if((pkt->type == pkt_PRESENCE || pkt->type == pkt_PRESENCE_UN)) {


if((pkt->type == pkt_PRESENCE || pkt->type == pkt_PRESENCE_UN) && strcmp(jid_full(pkt->rfrom), "sm") != 0)

but I doubt if this is acceptable as real fix.

Does someone have a better idea? Thanks in advance!


Reply via email to