how to add new buddy in roster in xmpp
Asked Answered
F

2

8

Hi i am using smack.jar.I am able to connect with gtalk using it.Using Roster.getentries() i can get my buddy list.But how can i add new friends to my buddyList.Is there any API smack exposes to add new users??

Thanks

Flaky answered 7/10, 2010 at 8:53 Comment(0)
B
11

I've been using this to create new contacts in a standard XMPP server (can't tell about gtalk):

  Roster roster = xmppConnection.getRoster();
  // jid: String, user: String, groups: String[]
  roster.createEntry(jid, user, groups);
Bylaw answered 9/10, 2010 at 6:39 Comment(2)
You'll probably want to listen for inbound subscription requests as well, since when you subscribe to someone, they often subscribe back.Tannen
how the friend will listen that he or she has been added to someones list or someone wants to add him as friend.. Please reply @JoeHildebrandVespid
R
5

In XMPP, adding is adding to your roster + subscribing to the user. Updating is just adding the user to your roster. Keep in mind the minutiae.

Radioscope answered 9/10, 2010 at 15:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.