Allow creating a MemoChat from Matrix by inviting own puppet to DM
WARNING: Seems to always fail with -203 (Invalid body)
This commit is contained in:
parent
36598c34f6
commit
45fdd5ca29
|
@ -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({
|
||||
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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue