How to add a single friend or remove a single friend
Koran
✭
in Photon Chat
Hi guys,
I use Photon Chat. I use chatClient.AddFriends( friendNamesArray ) to add the list of friends for which I want to get the online status. I have a feature that allows you to add a friend (or remove a friend). The friend list is stored by the app. Is there a way I can add a single friend to Photon or do I need to:
chatClient.RemoveFriends( oldFriendNamesArray ) and then do chatClient.AddFriends( newFriendNamesArrayWithOneMoreFriend ) or will photon add the diff between the first list and the new list by just calling chatClient.AddFriends( newFriendNamesArrayWithOneMoreFriend )?
Thanks,
I use Photon Chat. I use chatClient.AddFriends( friendNamesArray ) to add the list of friends for which I want to get the online status. I have a feature that allows you to add a friend (or remove a friend). The friend list is stored by the app. Is there a way I can add a single friend to Photon or do I need to:
chatClient.RemoveFriends( oldFriendNamesArray ) and then do chatClient.AddFriends( newFriendNamesArrayWithOneMoreFriend ) or will photon add the diff between the first list and the new list by just calling chatClient.AddFriends( newFriendNamesArrayWithOneMoreFriend )?
Thanks,
0
Comments
-
Hello,
As far as i can tell, PhotonChat uses array and not List.
That mean it will be reassigned every time.
So if you do
chatClient.AddFriends( list of 3 friends );
chatClient.AddFriends( list of 2 friends );
Should be a list of 2 friends.
0 -