/// <summary> /// tries to decline a friend request from user with username /// </summary> public void DeclineFriendRequestFrom(string username) { if (UnopenedFriendRequests.Contains(username)) { FriendsDal.ChangeStatus(username, this.username, (int)FriendRequestStatus.Declined); } else { throw new Exception("You Have No Friend Invitation From This Friend"); } }
/// <summary> /// tries to send a friend request and returns a textual response /// </summary> public string AddFriend(string username) { if (DeclinedFriends.Contains(username)) { FriendsDal.ChangeStatus(username, this.username, (int)FriendRequestStatus.Accepted); return("Your'e now friends with" + username); } else if (!FriendsDal.FriendRequestExists(username, this.username)) { FriendsDal.AddFriend(this.username, username); return("Your friend request has been sent successfuly to " + username); } return("there already exists a friend request between you and" + username); }