Adding a friend - reconnection needed?


I am trying to add a friend. Let’s say my name is Bob.

I have


and to add the friend (Alice):

roster.createEntry(alice@service, Alice, new String[] { "yadayada" });

Alice gets added, and I see the ItemType is set to “to” (i.e. waiting for acceptance).

Now, what should Alice do in order to accept the friendship request?

I am just adding Bob:

roster.createEntry(bob@service, Bob, new String[] { "yatta" });

Problem is, at this point our ItemType is set to “none” and the only way to get “both” seems to be to reconnect.

Is there a better way? :expressionless:



It turns out it is enough to send a Presence of type “subscribe” (if using SubscriptionMode.accept_all at least).

I was doing something wrong elsewhere