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

protocols: declare slash-in-nicks, slash-in-hosts, underscore-in-hosts as necessary (#337)

This commit is contained in:
James Lu 2017-03-15 23:58:51 -07:00
parent 936535786e
commit efe468b0d2
5 changed files with 9 additions and 1 deletions

View File

@ -14,7 +14,7 @@ class ClientbotWrapperProtocol(Protocol):
def __init__(self, irc): def __init__(self, irc):
super().__init__(irc) super().__init__(irc)
self.protocol_caps = {'clear-channels-on-leave'} self.protocol_caps = {'clear-channels-on-leave', 'slash-in-nicks', 'slash-in-hosts', 'underscore-in-hosts'}
self.has_eob = False self.has_eob = False

View File

@ -13,6 +13,9 @@ from pylinkirc.protocols.ts6_common import *
class InspIRCdProtocol(TS6BaseProtocol): class InspIRCdProtocol(TS6BaseProtocol):
def __init__(self, irc): def __init__(self, irc):
super().__init__(irc) super().__init__(irc)
self.protocol_caps |= {'slash-in-nicks', 'slash-in-hosts', 'underscore-in-hosts'}
# Set our case mapping (rfc1459 maps "\" and "|" together, for example). # Set our case mapping (rfc1459 maps "\" and "|" together, for example).
self.casemapping = 'rfc1459' self.casemapping = 'rfc1459'

View File

@ -35,6 +35,9 @@ def p10b64encode(num, length=2):
class P10SIDGenerator(): class P10SIDGenerator():
def __init__(self, irc): def __init__(self, irc):
self.irc = irc self.irc = irc
self.protocol_caps |= {'slash-in-hosts', 'underscore-in-hosts'}
try: try:
query = irc.serverdata["sidrange"] query = irc.serverdata["sidrange"]
except (KeyError, ValueError): except (KeyError, ValueError):

View File

@ -15,6 +15,7 @@ S2S_BUFSIZE = 510
class TS6Protocol(TS6BaseProtocol): class TS6Protocol(TS6BaseProtocol):
def __init__(self, irc): def __init__(self, irc):
super().__init__(irc) super().__init__(irc)
self.protocol_caps |= {'slash-in-hosts'}
self.casemapping = 'rfc1459' self.casemapping = 'rfc1459'
self.hook_map = {'SJOIN': 'JOIN', 'TB': 'TOPIC', 'TMODE': 'MODE', 'BMASK': 'MODE', self.hook_map = {'SJOIN': 'JOIN', 'TB': 'TOPIC', 'TMODE': 'MODE', 'BMASK': 'MODE',
'EUID': 'UID', 'RSFNC': 'SVSNICK', 'ETB': 'TOPIC'} 'EUID': 'UID', 'RSFNC': 'SVSNICK', 'ETB': 'TOPIC'}

View File

@ -23,6 +23,7 @@ S2S_BUFSIZE = 427
class UnrealProtocol(TS6BaseProtocol): class UnrealProtocol(TS6BaseProtocol):
def __init__(self, irc): def __init__(self, irc):
super().__init__(irc) super().__init__(irc)
self.protocol_caps |= {'slash-in-nicks', 'underscore-in-hosts'}
# Set our case mapping (rfc1459 maps "\" and "|" together, for example) # Set our case mapping (rfc1459 maps "\" and "|" together, for example)
self.casemapping = 'ascii' self.casemapping = 'ascii'
self.proto_ver = 4000 self.proto_ver = 4000