powered by Jive Software

How to handle incomming subscription request?

I have logged in to yahoo messenger as yahoo_1 and i am logged to yahoo_2 from my code using smack and openfire and kraken.

Now from yahoo messenger (yahoo_1) i am adding yahoo_2 so a subscription type packet is comming to my packet listener and i am accepting the request by doing the following:-

  1. roster.createEntry(yahoo_1, yahoo_1, new String[] { groupName } );
  2. Presence response = new Presence(Presence.Type.unsubscribed);
  3. response.setTo(yahoo_1);
  4. connection.sendPacket(response);

Now after accepting i found that four friend requests are comming to yahoo messenger of yahoo_1. I mean 4 friend request window is openning in my yahoo messenger saying that yahoo_2 want to add you.

  1. am i doing anything wrong?
  2. am i missing any important step?
  3. is there any way to set subscription type =“both”?
  4. i dont want that a friend request will come to yahoo_1 but inly to yahoo_2 in my code

Regards,

Samba

Any suggestions please???