From c7bad077fcca816f9aac681467a979b099b2b0fa Mon Sep 17 00:00:00 2001 From: Hri7566 Date: Sat, 13 Jul 2024 15:18:58 -0400 Subject: [PATCH] Mitigate issue where channel owner won't get certificate of award, but everyone else would --- src/channel/Channel.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/channel/Channel.ts b/src/channel/Channel.ts index 1aa5290..b5b4cff 100644 --- a/src/channel/Channel.ts +++ b/src/channel/Channel.ts @@ -958,12 +958,21 @@ export class Channel extends EventEmitter { }); if (banner == _id) { - this.sendNotification({ + const certificate = { title: "Certificate of Award", text: `Let it be known that ${p.name} kickbanned him/her self.`, duration: 7000, target: "#room" - }); + }; + + this.sendNotification(certificate); + + for (const s of socketsBySocketID.values()) { + const userID = s.getUserID(); + if (!userID) continue; + if (userID !== banner) continue; + s.sendNotification(certificate); + } } } }