开发者

how to add new buddy in roster in xmpp

开发者 https://www.devze.com 2023-01-19 05:24 出处:网络
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 e

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


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);


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消