From c52346268d6106a57c9550640cf59e1b8f5fe50e Mon Sep 17 00:00:00 2001 From: DCloud_JSON Date: Thu, 25 Apr 2024 14:45:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E5=88=9B=E5=BB=BA=E4=BC=9A=E8=AF=9D=E6=97=B6=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8F=82=E6=95=B0source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sdk/methods/conversation/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sdk/methods/conversation/index.js b/sdk/methods/conversation/index.js index 2e2781c..b32a09a 100644 --- a/sdk/methods/conversation/index.js +++ b/sdk/methods/conversation/index.js @@ -96,6 +96,16 @@ export default { "msgList": [], "update_time": Date.now() } + + /** + * 存在source字段的会话,表示此会话基于某个来源而被创建。 + * 比如:群聊会话,可能是从群聊列表中创建的,此时source字段会记录群聊的id + * 用于在云端同步创建会话时的判断依据,比如:限制只能群成员和群管理员才能发起私聊时,确定指的是哪个群 + */ + if(param.source){ + conversationData.source = param.source + } + this.add(conversationData) conversationDatas.push(conversationData) } else { -- GitLab