In my application I use a custom buddy persister. For adding a buddy I call the addBuddy() method from the client side. But to ban a user I use a custom method that sends a JSONObject directly to the extension handler. This is the essential part of my ban method :
As you can see I set the mutual add buddy to false to avoid the permission request because it isn't needed for banning. After the ban is performed I set to true the mutual add buddy.BuddyListManager bm = SmartFoxServer.getInstance().getZone(CoreExt.zoneName).getBuddyManager();
bm.setMutualAddBuddy(false);
bm.addBuddy(commanderName, bannedCommanderName);
bm.setMutualAddBuddy(true);
bm.setBuddyBlockStatus(user, bannedCommanderName, true);
I wonder if the BuddyListManager is threadsafe and if it's possible for a user to add a buddy when the permission is set to false. I hope it's the same thread server-side that handles the request from the client sent by methods sendXtMessage() and addBuddy().
Thanks for your answer.