private void AddFriendInternal(BnetEntityId entityId)
 {
     if (entityId != null)
     {
         BattleNet.FriendsUpdate item = new BattleNet.FriendsUpdate {
             action  = 1,
             entity1 = entityId
         };
         this.m_updateList.Add(item);
         base.m_battleNet.Presence.PresenceSubscribe(BnetEntityId.CreateForProtocol(entityId));
         this.m_friendEntityId.Add(entityId, new Map <ulong, EntityId>());
         this.m_friendsCount = (uint)this.m_friendEntityId.Count;
     }
 }
 private void RemoveFriendInternal(BnetEntityId entityId)
 {
     if (entityId != null)
     {
         BattleNet.FriendsUpdate item = new BattleNet.FriendsUpdate {
             action  = 2,
             entity1 = entityId
         };
         this.m_updateList.Add(item);
         base.m_battleNet.Presence.PresenceUnsubscribe(BnetEntityId.CreateForProtocol(entityId));
         if (this.m_friendEntityId.ContainsKey(entityId))
         {
             foreach (EntityId id in this.m_friendEntityId[entityId].Values)
             {
                 base.m_battleNet.Presence.PresenceUnsubscribe(id);
             }
             this.m_friendEntityId.Remove(entityId);
         }
         this.m_friendsCount = (uint)this.m_friendEntityId.Count;
     }
 }