Notifications
Clear all

Friend requests

7 Posts
2 Users
0 Reactions
657 Views
(@tommih)
Posts: 44
Trusted Member
Topic starter
 

Hello.

Once I've sent a contact request like this:

CombuManager.localUser.AddContact(addFriendField.texteContactType.Request, (successerror) => {
            if (success){
                UpdateFriendColumns();
            } else {
                Debug.LogError("Add Friend error: " + error);
            }
        });

... where should I look for the request after logging in with the other player (the one who the first player wants to make their friend)?

 
Posted : 12/09/2015 8:21 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

You can load the different contact type (request, friend, ignored) with User.LoadFriends and if it returns true in the callback then you can access the data with localUser.friends

In the next update you will have different arrays for friends, ignored and requests that are all set by LoadFriends based on the contact type requested, so you can call all of them in sequence and have all 3 contacts (though it's ever a good practice to implement a queue for requests instead of making 3 calls at time).

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 12/09/2015 8:32 pm
(@tommih)
Posts: 44
Trusted Member
Topic starter
 

Thanks for the response!

So, if I call for requests and after that I call for friends or ignored, will the list be replaced? Or will it then be a mix of different entries without any way to tell them apart? If the latter, can I somehow unload the previous list? What if I want to show the player the friends list and ignore list at the same time? Should I keep my own lists instead of relying on the localUser.friends? (There seems to be an "isFriend" variable in the IUserProfile class so I suppose that helps.)

Maybe I just don't quite grasp the good practice you describe. It seems to me the improvement you mention for the next update would make this a lot more convenient to work with.

 
Posted : 13/09/2015 3:38 am
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

For now it replaces the friends list with the latest called, so you need to maintain your own lists if you need all 3 at the same time. With next update it will replace their own separated lists friends, ignored and requests.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 13/09/2015 3:43 am
(@tommih)
Posts: 44
Trusted Member
Topic starter
 

OK. Then how do I accept or refuse a friend request? Do they vanish from the list when I do?

 
Posted : 13/09/2015 3:56 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

To accept a request you call AddContact passing eContactType.Friend (of course from the user who received the request).

To decline a request you call AddContact passing eContactType.Ignore, the player's contact will be deleted from the other but the other still exists in the local user contacts as ignored. If you want to completely delete the request then you can call directly RemoveContact.

I will explain better the whole process in the documentation as soon as possible.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 13/09/2015 5:17 pm
(@tommih)
Posts: 44
Trusted Member
Topic starter
 

Hello again,

Just a little feedback: The error message when you try to send a friend request to someone you've already sent a request to (or are already friends with) is very vague: "An error occurred".

 
Posted : 22/09/2015 10:09 pm
Share: