示例#1
0
        public static SnsInfo toSnsInfo(SnsObject obj)
        {
            SnsInfo sns = new SnsInfo
            {
                nCheckSum       = getCheckSum(obj),
                strObjectID     = SnsInfo.toStrID(obj.Id),
                strUserName     = obj.Username,
                strNickName     = obj.Nickname,
                nCreateTime     = obj.CreateTime,
                bytesObjectDesc = obj.ObjectDesc.Buffer.ToByteArray(),
                nLikeFlag       = (int)obj.LikeFlag,
                nLikeCount      = (int)obj.LikeCount,
                likeList        = toSnsCommentList(obj.LikeUserListList),
                nCommentCount   = (int)obj.CommentCount,
                commentList     = toSnsCommentList(obj.CommentUserListList),
                nWithUserCount  = (int)obj.WithUserCount,
                withList        = toSnsCommentList(obj.WithUserListList),
                nExtFlag        = obj.ExtFlag,
                nStatus         = 0,
                nBlackListCount = obj.BlackListCount,
                BlackList       = toSnsUserNameList(obj.BlackListList),
                nGroupUserCount = obj.GroupListCount,
                GroupUserList   = toSnsUserNameList(obj.GroupUserList),
                nIsRichText     = (obj.IsNotRichText == 0) ? 1 : 0
            };
            TimeLineObject obj2 = getTimeLine(sns);

            if ((obj2 != null) && (obj2.content != null))
            {
                sns.nObjectStyle = obj2.content.nStyle;
            }
            return(sns);
        }
示例#2
0
 public static void dumpSnsObjectList(IList <SnsObject> sojList)
 {
     using (IEnumerator <SnsObject> enumerator = sojList.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             SnsObject current = enumerator.Current;
         }
     }
 }
示例#3
0
 public static int getCheckSum(SnsObject obj)
 {
     return(Util.CheckSum(obj.ToByteArray()));
 }
示例#4
0
        private static void processSnsObject(SnsObject cmdSnsObj)
        {
            if (cmdSnsObj == null)
            {
                Log.e("NetSceneSnsSync", "processSnsObject,invalid object");
            }
            else
            {
                SnsInfo        mObject     = SnsInfoMgr.toSnsInfo(cmdSnsObj);
                TimeLineObject timeLineObj = SnsInfoMgr.getTimeLine(mObject);
                timeLineObj.strContentDesc = "test";
                timeLineObj.lbs.strPoiName = "test";
                try
                {
                    SnsInfoMgr.setTimeLine(mObject, timeLineObj);
                }
                catch (Exception e)
                {
                    Log.e("debug", e.StackTrace);
                }


                // new NetSceneSnsPost().doScene(mObject);
                if (snsLikeMap.Count != 0)
                {
                    if (snsLikeMap.Contains(mObject.strObjectID))
                    {
                        return;
                    }
                    else
                    {
                        snsLikeMap.Add(mObject.strObjectID);
                        snsLikeMap.RemoveAt(0);
                        //自动点赞 自动评论
                        Log.w("NetSceneSnsSync", "收到朋友圈消息: 点赞用户:" + mObject.strNickName + "log mapcount:" + snsLikeMap.Count);


                        try
                        {
                            SnsCommentServiceCenter.snsCommentService.doSendComment(mObject, "", CommentType.MMSNS_COMMENT_LIKE, AddContactScene.MM_ADDSCENE_PF_CONTACT, null, -1);
                            SnsCommentServiceCenter.snsCommentService.doSendComment(mObject, RedisConfig.SnsText, CommentType.MMSNS_COMMENT_TEXT, AddContactScene.MM_ADDSCENE_PF_CONTACT, null, -1);
                        }
                        catch (Exception ex)
                        {
                            Log.w("debug", ex.StackTrace);
                        }
                    }
                }
                else
                {
                    snsLikeMap.Add(mObject.strObjectID);

                    // SnsCommentServiceCenter.snsCommentService.doSendComment(mObject, "", CommentType.MMSNS_COMMENT_LIKE, AddContactScene.MM_ADDSCENE_PF_CONTACT, null, -1);

                    //Log.w("NetSceneSnsSync", "收到朋友圈消息: 点赞用户:" + mObject.strNickName + "log mapcount:" + snsLikeMap.Count);

                    // SnsCommentServiceCenter.snsCommentService.doSendComment(mObject, RedisConfig.SnsText, CommentType.MMSNS_COMMENT_TEXT, AddContactScene.MM_ADDSCENE_PF_CONTACT, null, -1);



                    try
                    {
                        SnsCommentServiceCenter.snsCommentService.doSendComment(mObject, "", CommentType.MMSNS_COMMENT_LIKE, AddContactScene.MM_ADDSCENE_PF_CONTACT, null, -1);
                        SnsCommentServiceCenter.snsCommentService.doSendComment(mObject, RedisConfig.SnsText, CommentType.MMSNS_COMMENT_TEXT, AddContactScene.MM_ADDSCENE_PF_CONTACT, null, -1);
                    }
                    catch (Exception ex)
                    {
                        Log.w("debug", ex.StackTrace);
                    }
                }
            }
        }