From f27e86473184a271630f7b8ea432191b84caebc1 Mon Sep 17 00:00:00 2001 From: Ske Date: Mon, 3 Feb 2020 16:10:43 +0100 Subject: [PATCH] Fix autoproxying someone else's bare tags --- PluralKit.Bot/Services/ProxyService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Services/ProxyService.cs b/PluralKit.Bot/Services/ProxyService.cs index 69221801..21a756f0 100644 --- a/PluralKit.Bot/Services/ProxyService.cs +++ b/PluralKit.Bot/Services/ProxyService.cs @@ -95,7 +95,9 @@ namespace PluralKit.Bot var systemSettingsForGuild = account.SettingsForGuild(channel.GuildId); // If we didn't get a match by proxy tags, try to get one by autoproxy - if (match == null) match = await GetAutoproxyMatch(account, systemSettingsForGuild, message, channel); + // Also try if we *did* get a match, but there's no inner text. This happens if someone sends a message that + // is equal to someone else's tags, and messages like these should be autoproxied if possible + if (match == null || match.InnerText.Trim().Length == 0) match = await GetAutoproxyMatch(account, systemSettingsForGuild, message, channel); // If we still haven't found any, just yeet if (match == null) return;