Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Page: previous  1  2 
Avatar
ayyrk #16
Member since Jul 2007 · 92 posts
Group memberships: Members, Premium
Show profile · Link to this post
In reply to post ID 3863
I am sorry if that was not clear. 

I am asking if I can isolate my local cache updating to the RosterItem callback by making RosterManager calls in the Presence callback. 

The server will generate RosterItem updates in response to the RosterManager calls.

Is the correct way to use the SDK?

Thanks!
Avatar
Alex #17
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post ID 3863
Quote by ayyrk:
Also should I be using XmppCon.RosterManager.AddRosterItem(fromJid) andXmppCon.RosterManager.RemoveRosterItem(fromJid) instead of updating my roster like this:

  1. _allBuddies.Remove(pres.From.User);
yes you should. If you send a subscribe for a contact which is not in your roster the server does the add automatically and sends you a roster push.
But to completely remove a contact from the roster you have to call to call Unsubscribe and RemoveRosterItem.
I have seen no user interface in your code. So it looks to me like you accept all requests automatically, so you can force an automatic remove in the presence unsubscribed event.

Quote by ayyrk:
I am adding and removing contacts from my buddy list in response to Presence callbacks. Question: Should I instead use the RosterManager add/remove calls inside the Presence callbacks? Would this cause the server to send me RosterItem changes?
yes it does

Quote by ayyrk:
Question: If I call RosterManager add/remove inside the Presence callback will that cause the server to send me RosterItem updates?
yes

Alex
Avatar
Alex #18
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
also make sure that you use only bare jids when dealing here with subscription and roster items.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page: previous  1  2 
Forum: agsXMPP RSS