Le 10/01/2014 18:23, Tomasz Sterna a écrit
You could have a separate "cron" component pinging 'sm' in regular
intervals with special route packet, and handle this special packet in
'in-router' chain of your module.

Having that it could even be done not in regular intervals, but
on-demand, when your component gets triggered by web frontend.




This works very well ! Thanks for the advice. My "cron" component is a short php script. I was unsure about how to answer "disco#info" queries that I get from other components, but it seems to work without answering anything. I'll read the "XEP-0030 : Service Discovery" RFC later and try to make a more compliant "cron" component. If anyone is interested in the php simple DIGEST-MD5 auth, code can be found here (It's not robust and exhaustive, but it can be useful I guess) :
https://github.com/Gugli/jabberd2/blob/master/tools/sendupdatepacket.php

I've been scratching my head for the last couple of days on another issue : our legacy contact system does not allow asymetrical relationships (as XMPP does). It would be very complicated to change that to a more "XMPP-compliant" system. The solution I came up with is to make a symmetrical mode for my roster module.
In this mode :
- whenever a user sends a presence subscription, the sm also consider the user allows subscription to the same contact. - whenever a user allows a contact to subscribe to his presence, the sm also consider that the user subscribe back to the same contact's presence. The session that requests the change has to be informed of this additional change with a push as any other session. Basically, item->from and item->to are linked, they always are the same value.

This makes a kind of "restricted XMPP" protocol. It's not great, but it's the only sensible way I found to go on. Has anyone already done something approaching ? Is it "bad" ?

Thanks very much again for all the help you provide :)

--
Sylvain "Gugli" Guglielmi





Reply via email to