Beispiel #1
0
        /// <summary>
        /// 加载本地历史消息
        /// </summary>


        internal void CustomExchange(CustomExchangePackage package)
        {
            int userid = package.data.originTo.ToInt();//用户ID

            if (package.data.userId != SDKClient.SDKClient.Instance.property.CurrentAccount.userID)
            {
                ChatViewModel chatVM = this.Items.FirstOrDefault(info => info.ID == userid);
                if (chatVM != null)
                {
                    chatVM.AddMessageTip("当前用户正在和其他客服进行沟通中", isSetLastMsg: false);
                    chatVM.sessionType = 2;
                    chatVM.StartOrStopSession(false);
                }
            }
            else
            {
                ChatViewModel chatVM = this.Items.FirstOrDefault(info => info.ID == userid);
                if (chatVM != null)
                {
                    chatVM.sessionType = 1;
                    chatVM.StartOrStopSession(true);

                    //添加通知消息
                    chatVM.AddMessageTip("会话转移接入成功", isSetLastMsg: false);
                }
            }
        }
Beispiel #2
0
        internal void CustomExchange(CustomExchangePackage package)
        {
            int            csid   = package.data.originTo.ToInt();
            TempCustomItem chatVM = this.Items.FirstOrDefault(t => t.ID == csid);

            if (chatVM != null)
            {
                App.Current.Dispatcher.Invoke(new Action(() =>
                {
                    this.Items.Remove(chatVM);
                }));
            }
        }