summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-02-08 11:41:12 +0100
committerRory& <root@rory.gay>2026-02-08 11:41:35 +0100
commit6ba8c382aaf26e33fc062beb75fe6e4661f35198 (patch)
tree9c4d8ae7a54b86aa55f085b9491bd206cc61b71d
parentproperly update last message id (diff)
downloadserver-ts-6ba8c382aaf26e33fc062beb75fe6e4661f35198.tar.xz
dont send channel create for dms that were already open???
-rw-r--r--src/util/entities/Channel.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/entities/Channel.ts b/src/util/entities/Channel.ts

index 52867a0c..cea2bfad 100644 --- a/src/util/entities/Channel.ts +++ b/src/util/entities/Channel.ts
@@ -434,6 +434,7 @@ export class Channel extends BaseClass { const type = recipients.length > 1 ? ChannelType.GROUP_DM : ChannelType.DM; let channel = null; + let needsTx = true; const channelRecipients = [...recipients, creator_user_id]; @@ -449,6 +450,7 @@ export class Channel extends BaseClass { if (channelRecipients.every((_) => re.includes(_))) { if (channel == null) { channel = ur.channel; + if (!ur.closed) needsTx = false; await ur.assign({ closed: false }).save(); } } @@ -476,7 +478,9 @@ export class Channel extends BaseClass { const channel_dto = await DmChannelDTO.from(channel); - if (type === ChannelType.GROUP_DM && channel.recipients) { + if (!needsTx) { + /*ignored*/ + } else if (type === ChannelType.GROUP_DM && channel.recipients) { for (const recipient of channel.recipients) { await emitEvent({ event: "CHANNEL_CREATE",