3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

hybrid, ts6: update mode definitions

- +p is actually just noknock on hybrid & charybdis
- Fill in *A-*D lists (they were incomplete)
This commit is contained in:
James Lu 2016-04-18 11:22:54 -07:00
parent 2b3307a96c
commit c59997827f
2 changed files with 10 additions and 31 deletions

View File

@ -25,13 +25,6 @@ class HybridProtocol(TS6Protocol):
ts = self.irc.start_ts ts = self.irc.start_ts
f = self.irc.send f = self.irc.send
# Valid keywords (from mostly InspIRCd's named modes):
# admin allowinvite autoop ban banexception blockcolor
# c_registered exemptchanops filter forward flood halfop history invex
# inviteonly joinflood key kicknorejoin limit moderated nickflood
# noctcp noextmsg nokick noknock nonick nonotice official-join op
# operonly opmoderated owner permanent private redirect regonly
# regmoderated secret sslonly stripcolor topiclock voice
# https://github.com/grawity/irc-docs/blob/master/server/ts6.txt#L80 # https://github.com/grawity/irc-docs/blob/master/server/ts6.txt#L80
cmodes = { cmodes = {
@ -42,17 +35,14 @@ class HybridProtocol(TS6Protocol):
# hybrid-specific modes: # hybrid-specific modes:
'blockcolor': 'c', 'inviteonly': 'i', 'noctcp': 'C', 'blockcolor': 'c', 'inviteonly': 'i', 'noctcp': 'C',
'regmoderated': 'M', 'operonly': 'O', 'regonly': 'R', 'regmoderated': 'M', 'operonly': 'O', 'regonly': 'R',
'sslonly': 'S', 'banexception': 'e', 'paranoia': 'p', 'sslonly': 'S', 'banexception': 'e', 'noknock': 'p',
'registered': 'r', 'invex': 'I', 'registered': 'r', 'invex': 'I',
# Now, map all the ABCD type modes: # Now, map all the ABCD type modes:
'*A': 'beI', '*B': 'k', '*C': 'l', '*D': 'cimnprstCMORS' '*A': 'beI', '*B': 'k', '*C': 'l', '*D': 'cimnprstCMORS'
} }
self.irc.cmodes.update(cmodes) self.irc.cmodes = cmodes
# Same thing with umodes:
# bot callerid cloak deaf_commonchan helpop hidechans hideoper invisible oper
# regdeaf servprotect showwhois snomask u_registered u_stripcolor wallops
umodes = { umodes = {
'oper': 'o', 'invisible': 'i', 'wallops': 'w', 'chary_locops': 'l', 'oper': 'o', 'invisible': 'i', 'wallops': 'w', 'chary_locops': 'l',
'cloak_hybrid': 'x', 'hidechans': 'p', 'regdeaf': 'R', 'deaf': 'D', 'cloak_hybrid': 'x', 'hidechans': 'p', 'regdeaf': 'R', 'deaf': 'D',
@ -66,7 +56,7 @@ class HybridProtocol(TS6Protocol):
'*A': '', '*B': '', '*C': '', '*D': 'oiwlpRDgdx' '*A': '', '*B': '', '*C': '', '*D': 'oiwlpRDgdx'
} }
self.irc.umodes.update(umodes) self.irc.umodes = umodes
# halfops is mandatory on Hybrid # halfops is mandatory on Hybrid
self.irc.prefixmodes = {'o': '@', 'h': '%', 'v': '+'} self.irc.prefixmodes = {'o': '@', 'h': '%', 'v': '+'}

View File

@ -248,20 +248,9 @@ class TS6Protocol(TS6BaseProtocol):
self.has_eob = False self.has_eob = False
f = self.irc.send f = self.irc.send
# Valid keywords (from mostly InspIRCd's named modes):
# admin allowinvite autoop ban banexception blockcolor
# c_registered exemptchanops filter forward flood halfop history invex
# inviteonly joinflood key kicknorejoin limit moderated nickflood
# noctcp noextmsg nokick noknock nonick nonotice official-join op
# operonly opmoderated owner permanent private redirect regonly
# regmoderated secret sslonly stripcolor topiclock voice
# https://github.com/grawity/irc-docs/blob/master/server/ts6.txt#L80 # https://github.com/grawity/irc-docs/blob/master/server/ts6.txt#L80
chary_cmodes = { # TS6 generic modes: chary_cmodes = { # TS6 generic modes (note that +p is noknock instead of private):
# Note: charybdis +p has the effect of being both
# noknock AND private. Surprisingly, mapping it twice
# works pretty well: setting +p on a charybdis relay
# server sets +pK on an InspIRCd network.
'op': 'o', 'voice': 'v', 'ban': 'b', 'key': 'k', 'limit': 'op': 'o', 'voice': 'v', 'ban': 'b', 'key': 'k', 'limit':
'l', 'moderated': 'm', 'noextmsg': 'n', 'noknock': 'p', 'l', 'moderated': 'm', 'noextmsg': 'n', 'noknock': 'p',
'secret': 's', 'topiclock': 't', 'secret': 's', 'topiclock': 't',
@ -274,7 +263,7 @@ class TS6Protocol(TS6BaseProtocol):
'operonly': 'O', 'adminonly': 'A', 'sslonly': 'S', 'operonly': 'O', 'adminonly': 'A', 'sslonly': 'S',
'nonotice': 'T', 'nonotice': 'T',
# Now, map all the ABCD type modes: # Now, map all the ABCD type modes:
'*A': 'beIq', '*B': 'k', '*C': 'l', '*D': 'mnprst'} '*A': 'beIq', '*B': 'k', '*C': 'lfj', '*D': 'mnprstFLPQcgzCOAST'}
if self.irc.serverdata.get('use_owner'): if self.irc.serverdata.get('use_owner'):
chary_cmodes['owner'] = 'y' chary_cmodes['owner'] = 'y'
@ -286,18 +275,17 @@ class TS6Protocol(TS6BaseProtocol):
chary_cmodes['halfop'] = 'h' chary_cmodes['halfop'] = 'h'
self.irc.prefixmodes['h'] = '%' self.irc.prefixmodes['h'] = '%'
self.irc.cmodes.update(chary_cmodes) self.irc.cmodes = chary_cmodes
# Same thing with umodes: # Define supported user modes
# bot callerid cloak deaf_commonchan helpop hidechans hideoper invisible oper regdeaf servprotect showwhois snomask u_registered u_stripcolor wallops
chary_umodes = {'deaf': 'D', 'servprotect': 'S', 'u_admin': 'a', chary_umodes = {'deaf': 'D', 'servprotect': 'S', 'u_admin': 'a',
'invisible': 'i', 'oper': 'o', 'wallops': 'w', 'invisible': 'i', 'oper': 'o', 'wallops': 'w',
'snomask': 's', 'u_noforward': 'Q', 'regdeaf': 'R', 'snomask': 's', 'u_noforward': 'Q', 'regdeaf': 'R',
'callerid': 'g', 'chary_operwall': 'z', 'chary_locops': 'callerid': 'g', 'chary_operwall': 'z', 'chary_locops':
'l', 'cloak': 'x', 'l', 'cloak': 'x',
# Now, map all the ABCD type modes: # Now, map all the ABCD type modes:
'*A': '', '*B': '', '*C': '', '*D': 'DSaiowsQRgzl'} '*A': '', '*B': '', '*C': '', '*D': 'DSaiowsQRgzlx'}
self.irc.umodes.update(chary_umodes) self.irc.umodes = chary_umodes
# Toggles support of shadowircd/elemental-ircd specific channel modes: # Toggles support of shadowircd/elemental-ircd specific channel modes:
# +T (no notice), +u (hidden ban list), +E (no kicks), +J (blocks kickrejoin), # +T (no notice), +u (hidden ban list), +E (no kicks), +J (blocks kickrejoin),
@ -308,6 +296,7 @@ class TS6Protocol(TS6BaseProtocol):
'kicknorejoin': 'J', 'repeat': 'K', 'nonick': 'd'} 'kicknorejoin': 'J', 'repeat': 'K', 'nonick': 'd'}
self.irc.cmodes.update(elemental_cmodes) self.irc.cmodes.update(elemental_cmodes)
self.irc.cmodes['*D'] += ''.join(elemental_cmodes.values()) self.irc.cmodes['*D'] += ''.join(elemental_cmodes.values())
elemental_umodes = {'u_noctcp': 'C', 'deaf': 'D', 'bot': 'B', 'u_noinvite': 'V', elemental_umodes = {'u_noctcp': 'C', 'deaf': 'D', 'bot': 'B', 'u_noinvite': 'V',
'hidechans': 'I'} 'hidechans': 'I'}
self.irc.umodes.update(elemental_umodes) self.irc.umodes.update(elemental_umodes)