protected override void onSuccess(SnsObjectDetailRequest request, SnsObjectDetailResponse response)
        {
            RetConst ret = (RetConst)response.BaseResponse.Ret;

            if (ret != RetConst.MM_OK)
            {
                Log.e("NetSceneSnsComment", "send request failed ret =" + ret);
                if (RetConst.MM_ERR_ARG == ret)
                {
                    //EventCenter.postEvent(EventConst.ON_NETSCENE_SNS_GETDETAIL_ERR, this.mObjectID, null);
                }
            }
            else
            {
                SnsInfoMgr.toSnsInfo(response.Object);
            }
        }
Exemple #2
0
        protected override void onSuccess(SnsPostRequest request, SnsPostResponse response)
        {
            RetConst ret = (RetConst)response.BaseResponse.Ret;

            if (ret != RetConst.MM_OK)
            {
                Log.e("NetSceneSnsPost", "send request failed ret =" + ret);

                // EventCenter.postEvent(EventConst.ON_NETSCENE_SNS_POST_ERR, ret, null);
            }

            else
            {
                SnsInfo item = SnsInfoMgr.toSnsInfo(response.SnsObject);

                Log.d("NetSceneSnsPost", "post success bytesObjectDesc = " + Util.ByteArrayToString(item.bytesObjectDesc));
            }
        }
        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);
                    }
                }
            }
        }