From a83e9306bb8d8e1362b632b3b25c4369da5ee293 Mon Sep 17 00:00:00 2001 From: Ske Date: Wed, 24 Jun 2020 16:48:55 +0200 Subject: [PATCH] Reimplement autoproxy escape character --- PluralKit.Bot/Proxy/ProxyMatcher.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PluralKit.Bot/Proxy/ProxyMatcher.cs b/PluralKit.Bot/Proxy/ProxyMatcher.cs index 5dcfbdc9..6a32f51c 100644 --- a/PluralKit.Bot/Proxy/ProxyMatcher.cs +++ b/PluralKit.Bot/Proxy/ProxyMatcher.cs @@ -9,6 +9,7 @@ namespace PluralKit.Bot { public class ProxyMatcher { + private static readonly char AutoproxyEscapeCharacter = '\\'; private static readonly Duration LatchExpiryTime = Duration.FromHours(6); private readonly IClock _clock; @@ -42,6 +43,10 @@ namespace PluralKit.Bot { match = default; + // Skip autoproxy match if we hit the escape character + if (messageContent.StartsWith(AutoproxyEscapeCharacter)) + return false; + // Find the member we should autoproxy (null if none) var member = ctx.AutoproxyMode switch {