Please ignore this.... :)

My modifications to the RosterStorage where preventing the subscribe presence stanza to reach my component.

Thanks,

Em Feb 5, 2007, às 12:11 PM, Pedro Melo escreveu:

Hi,

At work I needed to implement a component for a subdomin in which all their users have the following behavior. It will be used to add phone numbers as JIDs to your roster, acting as a helper for SIP and to send and receive SMSs.

 * They are always online;
* They always accept subscription requests and try to subscribe the JID that asks.

As a base for this I wrote a subclass of Component and Component::Node. This deals with all the IQ disco, and VCard stuff simply and effectively.

I started with the InMemory RosterStorage to deal with the roster, subclass it to override load_roster, so that when asked to be subscribed I could reply with a subscription of 'from'. This deals with the "always accept subscription requests" part.

I've also hooked the PresenceChecker phase to give back a valid presence every time. Now they are always online.

The only thing that I wasn't able to see a way to do with current hooks is sending back a subscription request for each subscription. I've added a new phase, PresenceSubscriptionRequested but I think we could add hooks on all roster-change related presences....

Opinions?
--
Pedro Melo
Blog: http://www.simplicidade.org/notes/
Jabber ID: [EMAIL PROTECTED]
Use Jabber!



--
Pedro Melo
Blog: http://www.simplicidade.org/notes/
Jabber ID: [EMAIL PROTECTED]
Use Jabber!


Reply via email to