3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-18 08:02:51 +01:00

relay: convert / to . in hostnames on hybrid

Also, switch this check to a whitelist instead of a blacklist for better compatibility.
This commit is contained in:
James Lu 2016-08-07 15:16:37 -07:00
parent c40895e221
commit 990f24938b

View File

@ -184,8 +184,8 @@ def normalizeNick(irc, netname, nick, times_tagged=0, uid=''):
def normalizeHost(irc, host): def normalizeHost(irc, host):
"""Creates a normalized hostname for the given host suitable for """Creates a normalized hostname for the given host suitable for
introduction to a remote network (as a relay client).""" introduction to a remote network (as a relay client)."""
if irc.protoname == 'unreal': if irc.protoname not in ('inspircd', 'ts6', 'clientbot', 'nefarious'):
# UnrealIRCd doesn't allow slashes in hostnames # UnrealIRCd and IRCd-Hybrid don't allow slashes in hostnames
host = host.replace('/', '.') host = host.replace('/', '.')
return host[:63] # Limit hosts to 63 chars for best compatibility return host[:63] # Limit hosts to 63 chars for best compatibility