[JDEV] Problems with Jabberd1.4.2

Mike Prince mike at mikeprince.com
Fri Mar 28 11:58:27 CST 2003


> -----Original Message-----
> From: jdev-admin at jabber.org [mailto:jdev-admin at jabber.org] On 
> Behalf Of Aaron Caskey
> Sent: Thursday, March 27, 2003 6:37 PM
> To: jadmin at jabber.org; jdev at jabber.org
> Subject: [JDEV] Problems with Jabberd1.4.2
> 
> 
> I'm in the process of setting up a Jabber Server for our 
> organisation and I have created a bunch of scripts to allow 
> users to quickly add departments and individuals to their roster.
> 
> I am manipulating the user.xml files directly and have set 
> the timeout to 0. The server seems to be picking up roster 
> changes, but only partially.

Which timeout?

> The main problem is that one user can see another, but the 
> reverse is not the case, even tho both users registration is 
> set to "both"

By 'see another', do you mean they are in each-others roster?  Or do you
mean presence is functioning correctly and they appear 'online'?
 
> Resending a subscribe request will sometimes update the 
> status but it will only do it once, and if the other user's 
> status changes then another subscribe needs to be sent. It 
> seems to me that the servers internal state is getting out of 
> sync with whats in the files.
> 
> Is there a way to tell jabberd to reread all the user.xml 
> files without restarting it?

I am doing the same thing; using a component to modify roster entries
and then forcing them to propogate to clients.  Here's how I do it...

1) Read in the existing roster using and <iq get> request.
2) Modify the roster with my new entries
3) Write out the full new roster using an <iq set> request

Here's how I refresh the server

4) Fake an offline/online cycle from the client.  This causes the roster
logic in the server to reload.

Here's how we update the clients to know about the updated roster.  BTW,
we're also *forcing* subscriptions here and completely bypassing the
subscribe cycle.

5) <probe> all the online clients (resources) for this user
6) For each client that responds, send an <iq set> to the specific
resource

Note that subscriptions are symetric.  In my system both users are on
the same Jabber server and I'm able to force the reciprocal
subscription.   This would require extra work to function across
domains.

> On an unrelated note is there a way to tell jabberd to resend 
> roster information to a client (This would probably 
> facilitate rereading the user.xml file and may answer my 
> first question)
> 
> Lastly would xdb_sql help with this at all? I don't really 
> want to move to this as it would require me to rewrite all my 
> setup and roster modification scripts.

Yes.  So instead of doing <iq> get's and set's you would just modify the
data directly in the database.  You'd still have to encourage the Jabber
server to reload the roster info (my offline/online cycle); as well as
do a push to the online clients.

For code examples, my Yaja! library comes with code to do the above.

Hope this helps,

Mike





More information about the JDev mailing list