[JDEV] Writing presence-enabled agents/components
Ralph Siemsen
ralphs at blueairnetworks.com
Mon Nov 18 13:20:40 CST 2002
I'm having some difficulties writing an external jabber component(agent)
to behave correctly with regards to presence - eg. I want users to be
able to subscribe my agent and see its presence, and vice versa.
The agent accepts presence subscriptions (replies with 'subscribed') and
also sends back its own subscription request, which the user has to
accept of course. Then, the agent receives presence events whenever the
user changes their status or disconnects - so far so good.
I'd like this to work the other way as well: if the agent disconnects
for some reason, users who have it subscribed should see presence
events. However it seems that the server does not forward such events
automatically - ie. the "rebroadcasting" of presence to all interested
parties does not seem to occur for an agent.
The only way around this seems to be to have the agent permanently store
the JIDs of all users who have subscribed the agent. Then upon connect
or disconnect, the agent has to explicitly send out presence events to
all those JIDs.
Have I missed something obvious? Is the intention for agents to
explicitly store their subscriber lists (on disk)? Or is there a way to
make use of the existing code in jabberd but applied to an agent?
-Ralph
More information about the JDev
mailing list