当前位置: 首页 > 工具软件 > portal-stack > 使用案例 >

android xmpp 删除好友列表,android - Delete a Friend from Roster in Xmpp/Openfire - Stack Overflow...

左丘宜然
2023-12-01

In my chat application. I am using smack library , with the help of Subscription Management I have done the part of adding a friend to the Roster of a particular person.

Now I want that when some person denies the friend request, I send a UNSUBSCRIBE PACKET to the other user for the same, the friend is not deleted from the roster of the other user. It simply shows NONE subscription.

CODE:

Presence unsubscribe = new Presence(Presence.Type.unsubscribe);

unsubscribe.setTo(ABC@ABC.COM);

connection.sendPacket(unsubscribe);

How can I delete the user from the Roster of the friend. I can do it from openfire portal but don't know how to do it from code.

 类似资料: