Ejemplo n.º 1
0
 public RecentConact()
 {
     if (lastMsg == null)
     {
         lastMsg = new P2PChatMsg();
     }
     if (userInfo == null)
     {
         userInfo = new NearChatInfo();
     }
 }
Ejemplo n.º 2
0
        private List <RecentConact> GetRecentConactList(object Parser, byte cmdId = 1)
        {
            uint parser = (uint)Parser;
            List <RecentConact> recentList = new List <RecentConact>();

            for (int i = 0; ; i++)
            {
                if (YunVaImInterface.parser_is_empty(parser, cmdId, i))
                {
                    break;
                }
                uint parserUerInfo = YunVaImInterface.yvpacket_get_nested_parser(parser);
                YunVaImInterface.parser_get_object(parser, 1, parserUerInfo, i);
                RecentConact context = new RecentConact();
                context.endId  = YunVaImInterface.parser_get_integer(parserUerInfo, 1, 0);
                context.unread = YunVaImInterface.parser_get_integer(parserUerInfo, 2, 0);
                YunvaLogPrint.YvInfoLog("ImFriendNearListNotify", string.Format("endId:{0},unread:{1}", context.endId, context.unread));
                uint chatParser = YunVaImInterface.yvpacket_get_nested_parser(parser);
                YunVaImInterface.parser_get_object(parserUerInfo, 3, chatParser, 0);
                context.lastMsg = chatMessageNotify(chatParser);
                uint nearChatParser = YunVaImInterface.yvpacket_get_nested_parser(parser);
                YunVaImInterface.parser_get_object(parserUerInfo, 4, nearChatParser, 0);
                NearChatInfo nearChatInfo = new NearChatInfo();
                nearChatInfo.nickName  = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 1, 0));
                nearChatInfo.userId    = YunVaImInterface.parser_get_integer(nearChatParser, 2, 0);
                nearChatInfo.iconUrl   = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 3, 0));
                nearChatInfo.online    = YunVaImInterface.parser_get_integer(nearChatParser, 4, 0);
                nearChatInfo.userLevel = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 5, 0));
                nearChatInfo.vipLevel  = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 6, 0));
                nearChatInfo.ext       = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 7, 0));
                nearChatInfo.shieldMsg = YunVaImInterface.parser_get_integer(nearChatParser, 8, 0);
                nearChatInfo.sex       = YunVaImInterface.parser_get_integer(nearChatParser, 9, 0);
                nearChatInfo.group     = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 10, 0));
                nearChatInfo.remark    = YunVaImInterface.IntPtrToString(YunVaImInterface.parser_get_string(nearChatParser, 11, 0));
                nearChatInfo.times     = YunVaImInterface.parser_get_integer(nearChatParser, 12, 0);
                YunvaLogPrint.YvInfoLog("ImFriendNearListNotify", string.Format("nickName:{0},userId:{1},iconUrl:{2},onLine:{3},userLevel:{4},vipLevel:{5},ext:{6},shieldmsg:{7},sex:{8},group:{9},remark:{10},times:{11}", nearChatInfo.nickName, nearChatInfo.userId, nearChatInfo.iconUrl, nearChatInfo.online, nearChatInfo.userLevel, nearChatInfo.vipLevel, nearChatInfo.ext, nearChatInfo.shieldMsg, nearChatInfo.sex, nearChatInfo.group, nearChatInfo.remark, nearChatInfo.times));
                context.userInfo = nearChatInfo;
                recentList.Add(context);
            }

            return(recentList);
        }