Exemplo 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);
     }
 }
Exemplo 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);
        }
Exemplo 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;
        }
Exemplo 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;
        }
Exemplo 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;
        }