Esempio n. 1
0
 /// <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);
     }
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        public User ConfirmFriend(User newFriend)
        {
            if (this.FriendsConfirmation.Contains(newFriend))
            {

                this.AddFriend(newFriend);
                newFriend.AddFriend(this);

                this.FriendsConfirmation.Remove(newFriend);
            }

            return this;
        }
Esempio n. 4
0
        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;
        }
Esempio n. 5
0
        public User AddFriendRequest(User friendRequest)
        {
            if (friendRequest.RequiresApprovalToFriend)
            {
                friendRequest.FriendsConfirmation.Add(this);
                return this;
            }

            this.Friends.Add(friendRequest);
            friendRequest.Friends.Add(this);
            return this;
        }