Reputation: 31
NSString *ipAddress =[NSMutableString stringWithFormat:@"%@@204.93.197.136", selectedBuddy];
XMPPJID *newBuddy hString:ipAddress];
[[self appDelegate].xmppRoster acceptPresenceSubscriptionRequestFrom:newBuddy andAddToRoster:YES];
This is the code I am using for accepting buddy request in xmpp, but problem is when accepting the request another person getting subscription request how to solve this problem.
Upvotes: 0
Views: 366
Reputation: 2310
You can easily check for the other user's roster elements that if the subscription request coming from the user is already asked for subscription from your end or not?
When you (A) send a request to a user (B). There will be one entry in A's roster with type = "subscription" also there will be an attribute for the item element of you xml response thay is called ask".
When B accept the request with your given method. A will get a subscription request too. You can check that if B is available in A's roster or not and handle accordingly.
Upvotes: 1