Re: gloox 0.7 final
From: Jakob Schroeter <js@xxxxxxxxxx>
Date: Sun, 06 Nov 2005 15:53:23 +0100
Hi Lou,

On Sunday November 6 2005 03:49, you wrote:
> In my particular case, the client will be making no changes to the
> roster.  It is only interested in getting the group lists and status
> changes from the server.  Put differently, it does not use synchronize().
> I'm really just using the Client's RosterManager so that I can tell what
> groups users are in.

In this case you probably don't need itemUpdated at all, provided there are no 
other resources connected for that JID which could possibly modify the 
roster.


> Otherwise, I'd probably be implementing 
> handlePresence instead.

If you were not interested in an item's group, name, etc., this would be 
sufficient.


> With the insight that you have provided above, it is time for me to go
> reread the docs.  I am new to XMPP/Jabber, and so some of the concepts
> involved are new to me.  Things such as "roster-push", which you clear
> up a bit above.  Is the invocation of the RosterListener::Roster()
> method the result of a "roster-pull"?  It appears to be the result of a
> query that was made by the RosterManager.

Yes, after successful authentication the RosterManager asks the server for the 
full server-side roster. RosterListener::roster() announces the arrival to 
the RosterListener. This happens only once per connection.


> > > So I'm not sure why I'm seeing itemChanged getting called instead of
> > > itemUpdated.  I am not doing any local modification of the roster. 
> > > That is just one example of where I appear to be lacking in my mental
> > > picture of how this is all supposed to work.
> >
> > If you get an itemChanged after the item changed its status that's the
> > expected behaviour.
>
> So itemChanged refers to any item change, whether it is done locally or
> caused by the server, and itemUpdated only refers to changes done by the
> server.  Is that correct?

No, itemChanged is for events generated by the remote contact/client, like 
going to 'Away' or 'DnD'. You cannot change a contact's status locally. These 
status changes are only temporary and not stored in the actual roster item 
representation on the server.

On the other hand, itemUpdated is for modifications your client, or another 
resource of your JID, does to the actual persistant item data (groups, name, 
subscription) on the server.


> In that case, will I get both 
> itemUpdated and itemChanged events for changes that came from the
> server?

No, you will never see both methods being called from RosterManager for one 
single event actually coming in from the server. They are inherently 
different.

Maybe the naming of the methods is confusing? What would you propose?


> I have managed to reproduce the behaviour that I was talking about
> before, and your patch does, indeed, produce the desired result.

Ok, so it will be in the next release.


> While you're revamping stuff, I have an issue with the debugging output.

Me, too.
There used to be a run-time switch in earlier releases. But the way I 
implemented it at that time wasn't very sophisticated. Now, I have a few 
ideas I want to test.
Ideally, --enable-debug just includes the respective compiler switches (-g 
etc.) and does not influence debugging output. Neither should the library 
itself print anything.

Thank you for your input, I'll surely take it into consideration.

cheers,
Jakob

Attachment: pgptmNVqSWi37.pgp
Description: PGP signature

-- 
gloox-dev mailing list
to unsubscribe:
send a message with subject 'unsubscribe gloox-dev' to minimalist@xxxxxxxxxx