//public static bool updateDownloadVoiceContext(MsgTrans voiceinfo)
        //{
        //    return StorageMgr.msgVoice.updateTransBySvrID(voiceinfo);
        //}

        public static bool updateVoiceMsgStatus(string talker, int svrID, MsgUIStatus status)
        {
            //ChatMsg item = StorageMgr.chatMsg.getBySvrID(talker, svrID);
            //if (item != null)
            //{
            //    item.nStatus = (int) status;
            //    StorageMgr.chatMsg.modifyMsg(item);
            //}
            Log.i("DownloadVoiceDBSync", "updateVoiceMsgStatus =" + status.ToString());
            return(true);
        }
Beispiel #2
0
        public static int convertStatus(int status)
        {
            MsgUIStatus processing = MsgUIStatus.Processing;

            if (status == 5)
            {
                processing = MsgUIStatus.Success;
            }
            else if (status == 4)
            {
                processing = MsgUIStatus.Fail;
            }
            return((int)processing);
        }
        public bool updateUploadImgContext(bool isUpdatechatMsg)
        {
            if (this.imgInfo == null)
            {
                return(false);
            }
            MsgUIStatus processing = MsgUIStatus.Processing;

            if (this.mStatus == 4)
            {
                processing = MsgUIStatus.Fail;
            }
            else if (this.mStatus == 5)
            {
                processing = MsgUIStatus.Success;
            }
            if (this.mStatus == 5)
            {
                if (isUpdatechatMsg)
                {
                    this.updateChatMsgState((int)processing);
                }
                // StorageMgr.msgImg.delByTransID(this.imgInfo.nMsgTransID);
            }
            else
            {
                if (isUpdatechatMsg)
                {
                    this.updateChatMsgState((int)processing);
                }
                //MsgTrans trans = StorageMgr.msgImg.getByMsgTransID(this.imgInfo.nMsgTransID);
                //if (trans != null)
                //{
                //    if (trans.nTotalDataLen == trans.nTransDataLen)
                //    {
                //        if (isUpdatechatMsg)
                //        {
                //            this.updateChatMsgState(2);
                //        }
                //       // StorageMgr.msgImg.delByTransID(this.imgInfo.nMsgTransID);
                //        return true;
                //    }
                //    this.imgInfo.nStatus = this.mStatus;
                //    this.imgInfo.nLastModifyTime = (uint) (Util.getNowMilliseconds() / 1000.0);
                //   // StorageMgr.msgImg.update(this.imgInfo);
                //}
            }
            return(true);
        }