From f9e6c8817d198fa964f7ac76defca945fb752b96 Mon Sep 17 00:00:00 2001 From: Duy /zuey/ Date: Thu, 23 Apr 2026 23:48:11 +0700 Subject: [PATCH] fix(discord): remove redundant allowlist gate that broke pairing/allowlist policies (#985) (#1010) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit handleMessage ran an extra IsAllowed(senderID) check after checkDMPolicy/checkGroupPolicy, creating a double-gate. When DM/Group policy was set to "pairing" or "allowlist" with an allowlist configured, paired users were wrongly rejected because they were not individually listed. Telegram has no such post-policy gate — CheckDMPolicy and CheckGroupPolicy already handle allowlist + pairing correctly. Removing the redundant check aligns Discord with the shared policy semantics and fixes issue #985. --- internal/channels/discord/handler.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/internal/channels/discord/handler.go b/internal/channels/discord/handler.go index 7c466235..f54e86d1 100644 --- a/internal/channels/discord/handler.go +++ b/internal/channels/discord/handler.go @@ -58,15 +58,6 @@ func (c *Channel) handleMessage(_ *discordgo.Session, m *discordgo.MessageCreate } } - // Check allowlist (for "open" policy, still apply allowlist if configured) - if !c.IsAllowed(senderID) { - slog.Debug("discord message rejected by allowlist", - "user_id", senderID, - "username", senderName, - ) - return - } - // Handle bot commands (writer management, etc.) before further processing. if c.tryHandleCommand(m) { return