Exemple #1
0
        public static string getChatRoomDisplayName(string username, ref int usernum)
        {
            if ((username == null) || (username.Length <= 0))
            {
                return("");
            }
            if (ContactMgr.getUserType(username) != ContactMgr.UserType.UserTypeChatRoom)
            {
                return("");
            }
            List <Contact> list = ChatRoomMgr.getChatRoomMemberContactList(username);

            if ((list == null) || (list.Count < 1))
            {
                return("");
            }
            string str = "";

            foreach (Contact contact in list)
            {
                if (contact.strUsrName != AccountMgr.curUserName)
                {
                    if (str != "")
                    {
                        str = str + "," + GetContactDisplayName(contact);
                    }
                    else
                    {
                        str = str + GetContactDisplayName(contact);
                    }
                }
            }
            usernum = list.Count;
            return(str);
        }
Exemple #2
0
        public static bool IsSupportConversation(this ChatMsg msg)
        {
            if (msg == null)
            {
                return(false);
            }
            ContactMgr.UserType type = ContactMgr.getUserType(msg.strTalker);
            if (msg.strTalker == "sysnotice")
            {
                return(false);
            }
            if (msg.strTalker == "pc_share")
            {
                return(false);
            }
            if ((type == ContactMgr.UserType.UserTypeNormal) && ContactHelper.IsInVerifiedEntryContact(msg.strTalker))
            {
                return(false);
            }
            if (type == ContactMgr.UserType.UserTypeQQ)
            {
                return(false);
            }
            if (type == ContactMgr.UserType.UserTypeBottle)
            {
                return(false);
            }
            //if ((((type != ContactMgr.UserType.UserTypeChatRoom) && (type != ContactMgr.UserType.UserTypeNormal)) && (type != ContactMgr.UserType.UserTypeQQ)) && ((type != ContactMgr.UserType.UserTypePlugin) || (((msg.strTalker != "weixin") && ((msg.strTalker != "fmessage") || (FMsgMgr.getFMsgType(msg) != FMsgType.other))) && ((!(msg.strTalker == ConstantValue.TAG_BLOGAPP) && !(msg.strTalker == ConstantValue.TAG_NEWS)) && !(msg.strTalker == ConstantValue.TAG_QQMAIL)))))
            if ((((type != ContactMgr.UserType.UserTypeChatRoom) && (type != ContactMgr.UserType.UserTypeNormal)) && (type != ContactMgr.UserType.UserTypeQQ)) && ((type != ContactMgr.UserType.UserTypePlugin) || (((msg.strTalker != "weixin") && ((msg.strTalker != "fmessage"))) && ((!(msg.strTalker == ConstantValue.TAG_BLOGAPP) && !(msg.strTalker == ConstantValue.TAG_NEWS)) && !(msg.strTalker == ConstantValue.TAG_QQMAIL)))))

            {
                return(false);
            }
            return(true);
        }
Exemple #3
0
        public static bool IsSupport(this ChatMsg msg)
        {
            if (msg == null)
            {
                return(false);
            }
            ContactMgr.UserType type = ContactMgr.getUserType(msg.strTalker);
            if (msg.strTalker == "sysnotice")
            {
                return(false);
            }
            if (msg.strTalker == "pc_share")
            {
                return(false);
            }
            switch (type)
            {
            case ContactMgr.UserType.UserTypeChatRoom:
            case ContactMgr.UserType.UserTypeNormal:
            case ContactMgr.UserType.UserTypeQQ:
                return(true);
            }
            switch (type)
            {
            case ContactMgr.UserType.UserTypeQQ:
                return(true);

            case ContactMgr.UserType.UserTypeBottle:
                return(true);
            }
            //return (((type == ContactMgr.UserType.UserTypePlugin) && (((msg.strTalker == "weixin") || ((msg.strTalker == "fmessage") && (FMsgMgr.getFMsgType(msg) == FMsgType.other))) || (((msg.strTalker == ConstantValue.TAG_BLOGAPP) || (msg.strTalker == ConstantValue.TAG_NEWS)) || (msg.strTalker == ConstantValue.TAG_QQMAIL)))) || msg.IsPushMsg());
            return(((type == ContactMgr.UserType.UserTypePlugin) && (((msg.strTalker == "weixin") || ((msg.strTalker == "fmessage"))) || (((msg.strTalker == ConstantValue.TAG_BLOGAPP) || (msg.strTalker == ConstantValue.TAG_NEWS)) || (msg.strTalker == ConstantValue.TAG_QQMAIL)))) || msg.IsPushMsg());
        }
Exemple #4
0
 public static bool isWithOfficialAcount(this ChatMsg msg)
 {
     if (msg == null)
     {
         return(false);
     }
     return((ContactMgr.getUserType(msg.strTalker) == ContactMgr.UserType.UserTypeNormal) && ContactHelper.IsVerifiedContact(msg.strTalker));
 }
Exemple #5
0
 public static List <string> getMembersByChatRoomName(string chatRoomName)
 {
     if (ContactMgr.getUserType(chatRoomName) != ContactMgr.UserType.UserTypeChatRoom)
     {
         Log.e("ChatRoomMgr", "getMembersByChatRoomName,room:" + chatRoomName);
         return(null);
     }
     return(getMemberListByChatroomName(chatRoomName));
 }
Exemple #6
0
        public static string getChatRoomStringInChat(string username, ref int num)
        {
            num = 0;
            if (string.IsNullOrEmpty(username))
            {
                return("");
            }
            if (ContactMgr.getUserType(username) != ContactMgr.UserType.UserTypeChatRoom)
            {
                return("");
            }
            getChatRoomDisplayName(username, ref num);
            string str = getDisplayName(username, (Contact)null);

            // ChatDefaultTopic=Group Chat

            if ((!(str == "Group Chat") && !string.IsNullOrEmpty(str)) && !(str == username))
            {
                return(str);
            }
            return("Group Chat");
        }
Exemple #7
0
 public static string GetContactDisplayName(Contact ct)
 {
     if (ct == null)
     {
         return("");
     }
     if ((ContactMgr.getUserType(ct.strUsrName) == ContactMgr.UserType.UserTypeChatRoom) && !string.IsNullOrEmpty(ct.strNickName))
     {
         if ((!(ct.strNickName == "群聊") && !(ct.strNickName == "聊天室")) && !(ct.strNickName == "Group Chat"))
         {
             return(ct.strNickName);
         }
         return("Group Chat");
     }
     //if (ToolFunction.checkIsLegalRemark(ct.strRemark))
     //{
     //    return ct.strRemark;
     //}
     if (!string.IsNullOrEmpty(ct.strNickName))
     {
         return(ct.strNickName);
     }
     return(ct.strUsrName);
 }