I'm developing a jabberd 1.4.2 module which only aim is to know whenever some user connects/disconnects to/from the jabber server (and update a db accordingly).
I'd like to know wheter the logic behind my code is OK:
1 ) To know when a user connects, I have a callback associated to e_SESSION event. That's all.
2 ) To know when a user disconnects, I have a callback associated to e_DELIVER event. Then I filter JPACKET_PRESENCE packets, and then I filter those packets which are JPACKET__UNAVAILABLE and which user->sessions is not NULL (I found that I was receiving the unavailable packet twice every time a user disconnected... the only difference I found between those packets was user->sessions. Is there any other way?).
Is it ok? (it works... but maybe I'm omitting something.
I'm also wondering why I'm receiving "unavailables" from msn transport users but I don't receive "available" packets... I launch my module after all jsm modules are launched... may this be the reason?(although msn transport is launched after these modules, isn't it?) I get a log like this when dperez (me) disconnects from the server (POA is the code name of the module):
Fri Nov 21 13:26:05 2003 presence.c:64 POA :: dperez/Work is connected
Fri Nov 21 13:27:10 2003 presence.c:108 POA :: dperez/Work has left.
Fri Nov 21 13:27:10 2003 presence.c:108 POA :: (null)/registered has left. <----------------------------- I suppose this is the msn transport fake user.
Fri Nov 21 13:27:10 2003 presence.c:108 POA :: foo1%hotmail.com/(null) has left. (when does this user connects?)
Fri Nov 21 13:27:10 2003 presence.c:108 POA :: foo2%hotmail.com/(null) has left. (and this? He may be foo1's friend ;-) )
Thanks in advance,
<<inline: D:\\dperez\\firma.png>>
