In my application, when I send a request to any friend using this code.
try { roster.createEntry(idExtension, nickname, null); roster.setSubscriptionMode(Roster.SubscriptionMode.manual); Presence subscribe = new Presence(Presence.Type.subscribe); subscribe.setTo(idExtension); connection.sendPacket(subscribe); return true; } catch (XMPPException e) { System.err.println("Error in adding friend"); return false; }
then the subscription says βNONEβ on both friends lists.
But it must be "TO" and "FROM".
But if for the same process I use this code -
try { roster.createEntry(idExtension, nickname, null); roster.setSubscriptionMode(Roster.SubscriptionMode.manual); Presence subscribed = new Presence(Presence.Type.subscribed); subscribed.setTo(idExtension); connection.sendPacket(subscribed); return true; } catch (XMPPException e) { System.err.println("Error in adding friend"); return false; }
Then it gives me the correct result, which I should get in the previous case.
Please tell me why I do not get the same in SUBSCRIBE mode.
thanks
source share