Beispiel #1
0
        public bool isOnlyMeSelected()
        {
            if (this.reactionsCountDict.isNotNullAndEmpty())
            {
                if (this.reactionsCountDict.Sum(entry => entry.Value) > 0)
                {
                    return(false);
                }
            }
            var localData = MyReactionsManager.getMessageReactions(this.id);

            return(localData.isNotNullAndEmpty() && localData.Sum(entry => entry.Value) == 1);
        }
Beispiel #2
0
        public bool isReactionsEmpty()
        {
            if (this.reactionsCountDict.isNotNullAndEmpty())
            {
                if (this.reactionsCountDict.Sum(entry => entry.Value) > 0)
                {
                    return(false);
                }
            }
            var localData = MyReactionsManager.getMessageReactions(this.id);

            return(localData.isNullOrEmpty() || localData.Sum(entry => entry.Value) == 0);
        }
Beispiel #3
0
 public void fillReactionsCountDict()
 {
     if (MyReactionsManager.getMessageReactions(this.id) != null)
     {
         foreach (var pair in MyReactionsManager.getMessageReactions(this.id))
         {
             if (pair.Value > 0 && !this.reactionsCountDict.ContainsKey(pair.Key))
             {
                 this.reactionsCountDict[pair.Key] = 0;
             }
         }
     }
 }
Beispiel #4
0
        public bool isReactionSelectedByLocalAndServer(string type)
        {
            var localData = MyReactionsManager.getMessageReactions(this.id);
            var myUserId  = UserInfoManager.getUserInfo().userId;

            if (localData == null)
            {
                return(this.getUserReactionsDict(myUserId) != null &&
                       this.getUserReactionsDict(myUserId).ContainsKey(type) &&
                       this.getUserReactionsDict(myUserId)[type] == 1);
            }
            return(localData.ContainsKey(type) && localData[type] == 1);
        }