3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

unreal/ts6/relay: add some more user mode support

Cloaking is still a bit iffy on UnrealIRCd networks - Unreal insists on applying its own cloaking for +x users, but vHosts for non +x remote users don't apply at all (their real host is shown instead)
This commit is contained in:
James Lu 2015-11-21 23:57:24 -08:00
parent a3e0159054
commit 5c0517ba40
3 changed files with 14 additions and 3 deletions

View File

@ -536,7 +536,8 @@ whitelisted_cmodes = {'admin', 'allowinvite', 'autoop', 'ban', 'banexception',
'regmoderated', 'secret', 'sslonly', 'adminonly',
'stripcolor', 'topiclock', 'voice'}
whitelisted_umodes = {'bot', 'hidechans', 'hideoper', 'invisible', 'oper',
'regdeaf', 'u_stripcolor', 'u_noctcp', 'wallops'}
'regdeaf', 'u_stripcolor', 'u_noctcp', 'wallops',
'cloak', 'hideidle'}
def relayModes(irc, remoteirc, sender, channel, modes=None):
remotechan = getRemoteChan(irc, remoteirc, channel)
log.debug('(%s) Relay mode: remotechan for %s on %s is %s', irc.name, channel, irc.name, remotechan)

View File

@ -289,7 +289,7 @@ class TS6Protocol(TS6BaseProtocol):
'invisible': 'i', 'oper': 'o', 'wallops': 'w',
'snomask': 's', 'u_noforward': 'Q', 'regdeaf': 'R',
'callerid': 'g', 'chary_operwall': 'z', 'chary_locops':
'l',
'l', 'cloak': 'x',
# Now, map all the ABCD type modes:
'*A': '', '*B': '', '*C': '', '*D': 'DSaiowsQRgzl'}
self.irc.umodes.update(chary_umodes)

View File

@ -36,6 +36,7 @@ class UnrealProtocol(TS6BaseProtocol):
'C': 'noctcp', 'O': 'operonly', 'S': 'stripcolor',
'm': 'moderated', 'K': 'noknock', 'o': 'op', 'v': 'voice',
'I': 'invex', 't': 'topiclock', 'f': 'flood_unreal'}
self._neededCaps = ["VL", "SID", "CHANMODES", "NOQUIT", "SJ3"]
# Some command aliases
@ -243,7 +244,15 @@ class UnrealProtocol(TS6BaseProtocol):
"""Initializes a connection to a server."""
ts = self.irc.start_ts
self.irc.prefixmodes = {'q': '~', 'a': '&', 'o': '@', 'h': '%', 'v': '+'}
### XXX: fill out self.irc.umodes
self.irc.umodes.update({'deaf': 'd', 'invisible': 'i', 'hidechans': 'p',
'protected': 'q', 'registered': 'r',
'snomask': 's', 'vhost': 't', 'wallops': 'w',
'bot': 'B', 'cloak': 'x', 'ssl': 'z',
'filter': 'G', 'hideoper': 'H', 'hideidle': 'I',
'regdeaf': 'R', 'servprotect': 'S',
'u_noctcp': 'T', 'showwhois': 'W',
'*A': '', '*B': '', '*C': '', '*D': 'dipqrstwBxzGHIRSTW'})
f = self.irc.send
host = self.irc.serverdata["hostname"]
@ -262,6 +271,7 @@ class UnrealProtocol(TS6BaseProtocol):
f('SERVER %s 1 U%s-h6e-%s :%s' % (host, self.proto_ver, self.irc.sid, sdesc))
f('NETINFO 1 %s %s * 0 0 0 :%s' % (self.irc.start_ts, self.proto_ver, self.irc.serverdata.get("netname", self.irc.name)))
self._send(self.irc.sid, 'EOS')
self.irc.connected.set()
def handle_uid(self, numeric, command, args):