From a03214514c697087972289aac8e6cf5e9732ddca Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 11 Aug 2017 13:45:40 -0700 Subject: [PATCH] hybrid, ts6, ratbox: fix +p mode definitions properly +p is noknock and rfc1459-style private on all 3 IRCds, though the latter bit is undocumented in /help cmodes (maybe it's assumed?) +p is also "paranoia" on hybrid, which adds more restrictions to halfops and /invite (cherry picked from commit c107f0062ffb25a54d52946a26725940865318bb) --- docs/technical/channel-modes.csv | 3 ++- protocols/hybrid.py | 6 ++++-- protocols/ratbox.py | 2 +- protocols/ts6.py | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/technical/channel-modes.csv b/docs/technical/channel-modes.csv index 366edfa..1eaf433 100644 --- a/docs/technical/channel-modes.csv +++ b/docs/technical/channel-modes.csv @@ -44,8 +44,9 @@ oplevel_apass,,,,,,,A,,A,A, oplevel_upass,,,,,,,U,,U,U, opmoderated,,U (extras/m_opmoderated),z,z,,,,,,, owner,,q (m_customprefix/m_chanprotect),,y (when enabled),q,,,,,, +paranoia,,,,,,p,,,,, permanent,,P (m_permchannels),P,P,P,,z,,,,P -private,p,p,,,p,,p,p,p,p,p +private,p,p,,,p,,p,,p,p,p quiet,,,q,q,,,,,,, redirect,,L (m_redirect),f,f,L,,L,,,, registered,,r (m_services_account),,,r,r,R,,R,R,r diff --git a/protocols/hybrid.py b/protocols/hybrid.py index e22e85e..6fa4903 100644 --- a/protocols/hybrid.py +++ b/protocols/hybrid.py @@ -23,16 +23,18 @@ class HybridProtocol(TS6Protocol): f = self.irc.send # https://github.com/grawity/irc-docs/blob/master/server/ts6.txt#L80 + # Note: according to hybrid source code, +p is paranoia, noknock, + # AND rfc1459-style private, though the last isn't documented. cmodes = { # TS6 generic modes: 'op': 'o', 'halfop': 'h', 'voice': 'v', 'ban': 'b', 'key': 'k', 'limit': 'l', 'moderated': 'm', 'noextmsg': 'n', - 'secret': 's', 'topiclock': 't', + 'secret': 's', 'topiclock': 't', 'private': 'p', # hybrid-specific modes: 'blockcolor': 'c', 'inviteonly': 'i', 'noctcp': 'C', 'regmoderated': 'M', 'operonly': 'O', 'regonly': 'R', 'sslonly': 'S', 'banexception': 'e', 'noknock': 'p', - 'registered': 'r', 'invex': 'I', + 'registered': 'r', 'invex': 'I', 'paranoia': 'p', # Now, map all the ABCD type modes: '*A': 'beI', '*B': 'k', '*C': 'l', '*D': 'cimnprstCMORS' } diff --git a/protocols/ratbox.py b/protocols/ratbox.py index fbf73cd..368fe5c 100644 --- a/protocols/ratbox.py +++ b/protocols/ratbox.py @@ -22,7 +22,7 @@ class RatboxProtocol(TS6Protocol): # Note: +r, +e, and +I support will be negotiated on link self.irc.cmodes = {'op': 'o', 'secret': 's', 'private': 'p', 'noextmsg': 'n', 'moderated': 'm', 'inviteonly': 'i', 'topiclock': 't', 'limit': 'l', 'ban': 'b', 'voice': 'v', - 'key': 'k', 'sslonly': 'S', + 'key': 'k', 'sslonly': 'S', 'noknock': 'p', '*A': 'beI', '*B': 'k', '*C': 'l', diff --git a/protocols/ts6.py b/protocols/ts6.py index d928203..c3b62b5 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -267,6 +267,7 @@ class TS6Protocol(TS6BaseProtocol): 'op': 'o', 'voice': 'v', 'ban': 'b', 'key': 'k', 'limit': 'l', 'moderated': 'm', 'noextmsg': 'n', 'noknock': 'p', 'secret': 's', 'topiclock': 't', 'inviteonly': 'i', + 'private': 'p', # charybdis-specific modes: 'quiet': 'q', 'redirect': 'f', 'freetarget': 'F', 'joinflood': 'j', 'largebanlist': 'L', 'permanent': 'P',