powered by Jive Software

How to add reject buddy support

Hi,

When someone (username:X) wants to add me (username:Me) as a buddy I get a add buddy accept or reject dialog. How can I reject this buddy request?

As if I want to accept friend request from X I can do:

Presence authorize = new Presence(Presence.Type.SUBSCRIBED);

authorize.setTo(from);

connection.sendPacket(authorize);

This is working fine. But if I wan’t to reject the friend request from X I am doing:

Presence auth = new Presence(Presence.Type.UNSUBSCRIBED);

auth.setTo(from);

connection.sendPacket(auth);

This is not working. How can I reject a friend request in Smack?

Thanks,

Neeta