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

relay: convert / to . in hostnames on hybrid

Also, switch this check to a whitelist instead of a blacklist for better compatibility.

(cherry picked from commit 990f24938b)
This commit is contained in:
James Lu 2016-08-07 15:16:37 -07:00
parent 05bc7e292f
commit 8341667bdd

View File

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