/// <summary> /// This adds the friend if it's not already in the list of friends /// </summary> /// <param name="friend"></param> internal void AddFriend(User friend) { if (!this.Friends.Contains(friend)) { this.Friends.Add(friend); } }
public User SendMessage(User recipient, string message, string title) { Message msg = new Message(); msg.MessageBody = message; msg.Title = title; msg.SentTime = DateTime.Now; return SendMessage(recipient, msg); }
public User ConfirmFriend(User newFriend) { if (this.FriendsConfirmation.Contains(newFriend)) { this.AddFriend(newFriend); newFriend.AddFriend(this); this.FriendsConfirmation.Remove(newFriend); } return this; }
public User SendMessage(User recipient, Message message) { //bail if ((recipient.AllowsMessagesFromNonFriends == false) && (!recipient.Friends.Contains(this))) { return this; } recipient.Messages.Add(message); this.SentMessages.Add(message); message.Sender = this; message.Recipients.Add(recipient); return this; }
public User AddFriendRequest(User friendRequest) { if (friendRequest.RequiresApprovalToFriend) { friendRequest.FriendsConfirmation.Add(this); return this; } this.Friends.Add(friendRequest); friendRequest.Friends.Add(this); return this; }