public void AcceptedFriendRequest(Reference <CoflnetUser> user) { // find the request on our side FriendRequest request = FriendRequests[user.Resource.Id.ToString()]; request.status = FriendRequest.RequestStatus.accepted; // add him to the friend list friends.Add(user); }
public void AcceptFriendRequest(FriendRequest request) { if (!request.TargetUser.Resource.Id.Equals(this.Id)) { throw new CoflnetException("wrong_user", "The user for which accepted this friend request is not the one this request is for", "You can't accept this request"); } // add him to our friend list friends.Add(request.RequestingUser); // tell his server to add him as well request.RequestingUser.ExecuteForEntity(new CommandData(this.Id, 0, "accepted_request")); }