From a77462d77a4c788c1be5f9f842638edc2de48a91 Mon Sep 17 00:00:00 2001 From: linju Date: Fri, 15 Nov 2024 14:49:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=94=B13.4.37=E6=9B=B4=E6=96=B0=E5=BC=95=E8=B5=B7=E7=9A=84?= =?UTF-8?q?=E8=A7=A3=E6=95=A3=E7=BE=A4=E5=8A=9F=E8=83=BD=E5=87=BA=E9=94=99?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uniCloud/cloudfunctions/uni-im-co/msg.js | 3 ++- uniCloud/database/uni-im-group.schema.ext.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/uniCloud/cloudfunctions/uni-im-co/msg.js b/uniCloud/cloudfunctions/uni-im-co/msg.js index d74c142..7ea3437 100644 --- a/uniCloud/cloudfunctions/uni-im-co/msg.js +++ b/uniCloud/cloudfunctions/uni-im-co/msg.js @@ -429,6 +429,7 @@ async function _createOrUpdateConversation(conversation_id, msgData, chat_source name: true }) .get() + console.error('groupInfo------', res.data[0]); groupInfo = res.data[0] } @@ -736,7 +737,7 @@ async function _processPush({ msgData, isMute, appId,groupInfo }) { const { nickname, avatar_file } = msgData let title let content - if(msgData.group_id){ + if(groupInfo){ title = groupInfo.name content = nickname.slice(0, 20) + ':' + (msgData.type == 'text'? msgData.body : '[多媒体]') }else{ diff --git a/uniCloud/database/uni-im-group.schema.ext.js b/uniCloud/database/uni-im-group.schema.ext.js index 3f80013..e224b5c 100644 --- a/uniCloud/database/uni-im-group.schema.ext.js +++ b/uniCloud/database/uni-im-group.schema.ext.js @@ -111,12 +111,12 @@ module.exports = { groupName:triggerContext.groupInfo.name, } } - await uniImCo.sendMsg(msgData,userInfo.uid) // 临时方案 加一条被软删除的群记录 await db.collection('uni-im-group').add({ ...triggerContext.groupInfo, is_delete:true }) + await uniImCo.sendMsg(msgData,userInfo.uid) } } } -- GitLab