mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 21:19:31 +01:00
Merge handle_invite into IRCS2SProtocol (#454)
This commit is contained in:
parent
2034bfcc83
commit
741528b0b3
@ -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
|
||||
|
@ -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]
|
||||
|
@ -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 <target nick>
|
||||
# 2 <channel>
|
||||
# - 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
|
||||
|
@ -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])
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user