Page 1 of 1

Add buddy offline

Posted: 05 Jul 2010, 08:15
by corwin
Hi, I want our users to be able to add buddies with mutual permission, while the buddies are offline. Any advices for the best way to do that?

Posted: 05 Jul 2010, 15:49
by Lapo
Well, until both users are online this is not technically possible.
With this in mind you could save the request in a Database and at login time, when both users are online you could finally execute the mutual AddBuddy.

Posted: 06 Jul 2010, 08:27
by corwin
ok, I guess I'll make custom addFriend method. If user is online will "addBuddy" and send request to the friend. If not online will "addPermissionRequest". On login I'll "getPendingRequests" and check if my user has such. If so, will ask him to accept/reject.
So my problem and question is: how can fire onBuddyPermissionRequest on a client? It is not addBuddy, not addPermissionRequest and not setPermission Status...

Posted: 07 Jul 2010, 05:59
by Lapo
You should call an addBuddy from server side. If the BuddyList is configured to aks permission the request will be fired to the target Buddy

Posted: 07 Jul 2010, 13:13
by corwin
I see, you mean calling ExtensionHelper's addBuddy, not BuddyListManager's, because the latter adds the friend directly, without asking permission.
Ok, whatever, I will use my database to store friend requests and make custom extension permissionResponse..

Posted: 08 Jul 2010, 12:24
by Lapo
Exactly correct. Always use the Helper as it also take care of client updates, server side events etc...