diff --git a/node/src/client.js b/node/src/client.js index af913f4..abba74f 100644 --- a/node/src/client.js +++ b/node/src/client.js @@ -1135,10 +1135,16 @@ export default class PeerClient { * @param {Long} req.user_id */ createDirectChat = async (req) => { - const channelList = this.#getUser(req.mxid).talkClient.channelList.normal - const res = await channelList.createChannel({ - userList: [{ userId: req.user_id }], - }) + const userClient = this.#getUser(req.mxid) + const channelList = userClient.talkClient.channelList.normal + + const res = + req.user_id != userClient.userId + ? await channelList.createChannel({ + userList: [{ userId: req.user_id }], + }) + : await channelList.createMemoChannel() + if (!res.success) return res return makeCommandResult(res.result.channelId) }