diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 3eefe72..be76c2d 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -673,14 +673,6 @@ class InspIRCdProtocol(TS6BaseProtocol): # SVSTOPIC is used by InspIRCd module m_topiclock - its arguments are the same as FTOPIC handle_svstopic = handle_ftopic - def handle_invite(self, numeric, command, args): - """Handles incoming INVITEs.""" - # <- :70MAAAAAC INVITE 0ALAAAAAA #blah 0 - target = args[0] - channel = self.toLower(args[1]) - # We don't actually need to process this; just send the hook so plugins can use it - return {'target': target, 'channel': channel} - def handle_knock(self, numeric, command, args): """Handles channel KNOCKs.""" # <- :70MAAAAAA ENCAP * KNOCK #blah :abcdefg diff --git a/protocols/ircs2s_common.py b/protocols/ircs2s_common.py index 00ed56f..8146c67 100644 --- a/protocols/ircs2s_common.py +++ b/protocols/ircs2s_common.py @@ -234,6 +234,27 @@ class IRCS2SProtocol(IRCCommonProtocol): self.users[numeric].away = text = '' return {'text': text} + def handle_invite(self, numeric, command, args): + """Handles incoming INVITEs.""" + # TS6: + # <- :70MAAAAAC INVITE 0ALAAAAAA #blah 12345 + # P10: + # <- ABAAA I PyLink-devel #services 1460948992 + # Note that the target is a nickname, not a numeric. + + target = self._get_UID(args[0]) + channel = self.toLower(args[1]) + + curtime = int(time.time()) + try: + ts = int(args[2]) + except IndexError: + ts = curtime + + ts = ts or curtime # Treat 0 timestamps (e.g. inspircd) as the current time. + + return {'target': target, 'channel': channel, 'ts': ts} + def handle_kill(self, source, command, args): """Handles incoming KILLs.""" killed = args[0] diff --git a/protocols/p10.py b/protocols/p10.py index fa590bb..82d1095 100644 --- a/protocols/p10.py +++ b/protocols/p10.py @@ -1171,18 +1171,6 @@ class P10Protocol(IRCS2SProtocol): return {'channel': channel, 'setter': args[1], 'text': topic, 'oldtopic': oldtopic} - def handle_invite(self, source, command, args): - """Handles incoming INVITEs.""" - # From P10 docs: - # 1 - # 2 - # - note that the target is a nickname, not a numeric. - # <- ABAAA I PyLink-devel #services 1460948992 - target = self._get_UID(args[0]) - channel = self.toLower(args[1]) - - return {'target': target, 'channel': channel} - def handle_clearmode(self, numeric, command, args): """Handles CLEARMODE, which is used to clear a channel's modes.""" # <- ABAAA CM #test ovpsmikbl diff --git a/protocols/ts6.py b/protocols/ts6.py index 4002221..73466b7 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -632,18 +632,6 @@ class TS6Protocol(TS6BaseProtocol): self.channels[channel].topicset = True return {'channel': channel, 'setter': setter, 'ts': ts, 'text': topic} - def handle_invite(self, numeric, command, args): - """Handles incoming INVITEs.""" - # <- :70MAAAAAC INVITE 0ALAAAAAA #blah 12345 - target = args[0] - channel = self.toLower(args[1]) - try: - ts = args[2] - except IndexError: - ts = int(time.time()) - # We don't actually need to process this; it's just something plugins/hooks can use - return {'target': target, 'channel': channel, 'ts': ts} - def handle_chghost(self, numeric, command, args): """Handles incoming CHGHOST commands.""" target = self._get_UID(args[0]) diff --git a/protocols/unreal.py b/protocols/unreal.py index 2e63e0a..bcbc1aa 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -934,14 +934,6 @@ class UnrealProtocol(TS6BaseProtocol): self.users[target].realname = newgecos = args[1] return {'target': target, 'newgecos': newgecos} - def handle_invite(self, numeric, command, args): - """Handles incoming INVITEs.""" - # <- :GL INVITE PyLink-devel :#a - target = self._get_UID(args[0]) - channel = self.toLower(args[1]) - # We don't actually need to process this; it's just something plugins/hooks can use - return {'target': target, 'channel': channel} - def handle_kill(self, numeric, command, args): """Handles incoming KILLs.""" # <- :GL| KILL GLolol :hidden-1C620195!GL| (test)