From 3f5f1f9ada6665f8318a5f75eaa4e8c283ce2aeb Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Thu, 15 Oct 2020 17:26:52 +0200 Subject: [PATCH] Allow querying mask list modes with consistent syntax (non-strict) --- source/ircd/connection.d | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/ircd/connection.d b/source/ircd/connection.d index 8c7189a..036b9a3 100644 --- a/source/ircd/connection.d +++ b/source/ircd/connection.d @@ -1105,12 +1105,22 @@ class Connection } auto channel = channelRange[0]; + //NOTE: The RFCs are inconsistent on channel mode query syntax for mask list modes + // ('MODE #chan +b', but 'MODE #chan e' and 'MODE #chan I') + version (BasicFixes) + { + enum listQueryModes = ["+b", "+e", "+I", "e", "I"]; + } + else + { + enum listQueryModes = ["+b", "e", "I"]; + } + if (message.parameters.length == 1) { channel.sendModes(this); } - //TODO: If RFC-strictness is off, also allow '+e' and '+I' (?) - else if (message.parameters.length == 2 && ["+b", "e", "I"].canFind(message.parameters[1])) + else if (message.parameters.length == 2 && listQueryModes.canFind(message.parameters[1])) { auto listChar = message.parameters[1][$ - 1]; final switch (listChar)