Hi, in our application, we need to add offline user which stored in our database as buddy. We use "requestAddBuddyPermission" on the server side as following:
requestAddBuddyPermission(User sender, target_username, msg);
Offcause the sender is online, but the target_username is offline. The error as following:
=====================
[WARNING]> Exception in ExtensionHandler: java.lang.NullPointerException
Exception type: java.lang.NullPointerException
java.lang.NullPointerException
at it.gotoandplay.smartfoxserver.controllers.SystemHandler.askAddBuddyPermission<SystemHandler.java:3029>
at it.gotoandplay.smartfoxserver.extensions.ExtensionHelper.requestAddBuddyPermission(ExtensionHelper.java:1010)
at it.gotoandplay.extensions.examples.SimpleDbExtension.handleRequest)(SimpleDbExtension.java:3883)
....
======================
Pls give us hand to solve.
Best Regards/
Gu[/img]
how to add offline user as buddy
You can't ask the permission to a user that is not connected.
So if your system needs the permission from the target buddy it's not possible to do it when the user is off-line.
You could however intercept the add-buddy requests to offline users, store them in a database and when such user comes back online you can deliver it.
So if your system needs the permission from the target buddy it's not possible to do it when the user is off-line.
You could however intercept the add-buddy requests to offline users, store them in a database and when such user comes back online you can deliver it.
I cant get this system to work on my extension.Lapo wrote:You can't ask the permission to a user that is not connected.
So if your system needs the permission from the target buddy it's not possible to do it when the user is off-line.
You could however intercept the add-buddy requests to offline users, store them in a database and when such user comes back online you can deliver it.
Is the mutualaddBuddy triggered by the request sended by addBuddy or is triggered also by the _server.addBuddy() method.
I add the buddy serverSide but this doesnt trigger the add of me to the requester in the first place.
A(online) request to B(offline) ( i write this in DB )
B comes online and accepts ( i add A to B's Buddylist server side ) while A is offline.
B isnt in A's buddylist.
Here it is my config.
<offLineBuddyVariables>true</offLineBuddyVariables>
<addBuddyPermission>false</addBuddyPermission>
<permissionTimeOut>10</permissionTimeOut>
<mutualAddBuddy>true</mutualAddBuddy> <mutualRemoveBuddy>true</mutualRemoveBuddy>
Thanks
-
helloniklas
- Posts: 21
- Joined: 14 Sep 2009, 10:18
- Location: London
- Contact: