Exemple #1
0
 private void Xmpp_OnRosterItem(object sender, RosterItem item)
 {
     if (!Friends.ContainsKey(item.Jid.User))
     {
         Friends.Add(item.Jid.User, new ChatFriend(item));
     }
 }
 public void RemoveFriend(int id)
 {
     if (Friends.ContainsKey(id))
     {
         Friends.Remove(id);
     }
 }
 public void AddFriend(int id, MessengerFriend friend)
 {
     if (!Friends.ContainsKey(id))
     {
         Friends.Add(id, friend);
     }
 }
Exemple #4
0
 private void Xmpp_OnMessage(object sender, Message msg)
 {
     if (Friends.ContainsKey(msg.From.User) && !msg.From.User.Equals(msg.To.User))
     {
         Friends[msg.From.User].ReceiveMessage(msg.Body);
     }
     else
     {
     }
     MessageReceived?.Invoke(this, msg);
 }
Exemple #5
0
 private void Xmpp_OnPresence(object sender, Presence pres)
 {
     if (Friends.ContainsKey(pres.From.User))
     {
         Friends[pres.From.User].UpdatePresence(pres);
         OnFriendListChanged(false);
     }
     else if (!pres.From.User.Equals(xmpp.MyJID.User))
     {
     }
     PresenceRecieved?.Invoke(this, pres);
 }
 public bool IsFriends(int userTwoId) =>
 Friends.ContainsKey(userTwoId);
Exemple #7
0
 public bool IsFriend(User user) => Friends.ContainsKey(user.Id);