Add buddy offline

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

corwin
Posts: 77
Joined: 17 Jul 2009, 08:19

Add buddy offline

Postby corwin » 05 Jul 2010, 08:15

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?
User avatar
Lapo
Site Admin
Posts: 20834
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 05 Jul 2010, 15:49

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.
Lapo
--
gotoAndPlay()
...addicted to flash games
corwin
Posts: 77
Joined: 17 Jul 2009, 08:19

Postby corwin » 06 Jul 2010, 08:27

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...
User avatar
Lapo
Site Admin
Posts: 20834
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 07 Jul 2010, 05:59

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
Lapo

--

gotoAndPlay()

...addicted to flash games
corwin
Posts: 77
Joined: 17 Jul 2009, 08:19

Postby corwin » 07 Jul 2010, 13:13

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..
User avatar
Lapo
Site Admin
Posts: 20834
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 08 Jul 2010, 12:24

Exactly correct. Always use the Helper as it also take care of client updates, server side events etc...
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 3 guests