Fix autoproxying someone else's bare tags

This commit is contained in:
Ske 2020-02-03 16:10:43 +01:00
parent 951b089c97
commit f27e864731

View File

@ -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;