Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        //public static bool setChatRoomTopic(string chatRoomName, string chatRoomTopic)
        //{
        //    if (string.IsNullOrEmpty(chatRoomName) || (chatRoomTopic == null))
        //    {
        //        return false;
        //    }
        //    if (ContactMgr.getUserType(chatRoomName) != ContactMgr.UserType.UserTypeChatRoom)
        //    {
        //        Log.e("ChatRoomMgr", "invalid chatRoomName" + chatRoomName);
        //        return false;
        //    }
        //    Contact item = StorageMgr.contact.get(chatRoomName);
        //    if (item == null)
        //    {
        //        return false;
        //    }
        //    item.strNickName = chatRoomTopic;
        //    StorageMgr.contact.modify(item);
        //    return OpLogMgr.OpModChatRoomTopic(chatRoomName, chatRoomTopic);
        //}

        //public static bool SetModChatRoomNotify(string chatRoomName, bool enable)
        //{
        //    if (string.IsNullOrEmpty(chatRoomName))
        //    {
        //        return false;
        //    }
        //    if (ContactMgr.getUserType(chatRoomName) != ContactMgr.UserType.UserTypeChatRoom)
        //    {
        //        Log.e("ChatRoomMgr", "invalid chatRoomName" + chatRoomName);
        //        return false;
        //    }
        //    int num = enable ? 1 : 0;
        //    Contact item = StorageMgr.contact.get(chatRoomName);
        //    if (item == null)
        //    {
        //        return false;
        //    }
        //    item.nChatRoomNotify = (uint) num;
        //    StorageMgr.contact.modify(item);
        //    return OpLogMgr.OpModChatRoomNotify(chatRoomName, (uint) num);
        //}

        //public static List<string> stringToUsernameList(string userName)
        //{
        //    List<string> list = new List<string>();
        //    if (!string.IsNullOrWhiteSpace(userName))
        //    {
        //        string[] strArray = userName.Split("、".ToCharArray());
        //        for (int i = 0; i < strArray.Length; i++)
        //        {
        //            list.Add(strArray[i]);
        //        }
        //    }
        //    return list;
        //}

        public static string userNameListToNickNameString(List <string> userNameList)
        {
            string str = "";

            for (int i = 0; i < userNameList.Count; i++)
            {
                str = str + ContactHelper.getDisplayName(userNameList[i], (Contact)null);
                if (i < (userNameList.Count - 1))
                {
                    str = str + "、";
                }
            }
            return(str);
        }
Ejemplo n.º 3
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));
 }