diff --git a/uniCloud/cloudfunctions/uni-im-co/msg.js b/uniCloud/cloudfunctions/uni-im-co/msg.js index d74c142613bdcfe4a25caed2fabb0781ba8d4e6e..7ea3437c861cceb22dc39ca2d43264826622f76b 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 3f8001375b94ee02a5adb0c0f5de49c4c0c4983d..e224b5c1d28cd5e041c0a8df130f4c97ae04b8eb 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) } } }