mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-25 12:12:53 +01:00
unreal: fix JOIN handling & normalize channel case
Reported by Rascle on IRC.
This commit is contained in:
parent
cf5cc18855
commit
b78b911323
@ -513,8 +513,6 @@ class UnrealProtocol(TS6BaseProtocol):
|
|||||||
def handle_join(self, numeric, command, args):
|
def handle_join(self, numeric, command, args):
|
||||||
"""Handles the UnrealIRCd JOIN command."""
|
"""Handles the UnrealIRCd JOIN command."""
|
||||||
# <- :GL JOIN #pylink,#test
|
# <- :GL JOIN #pylink,#test
|
||||||
for channel in args[0].split(','):
|
|
||||||
c = self.irc.channels[channel]
|
|
||||||
if args[0] == '0':
|
if args[0] == '0':
|
||||||
# /join 0; part the user from all channels
|
# /join 0; part the user from all channels
|
||||||
oldchans = self.irc.users[numeric].channels.copy()
|
oldchans = self.irc.users[numeric].channels.copy()
|
||||||
@ -525,6 +523,13 @@ class UnrealProtocol(TS6BaseProtocol):
|
|||||||
self.irc.users[numeric].channels.discard(ch)
|
self.irc.users[numeric].channels.discard(ch)
|
||||||
return {'channels': oldchans, 'text': 'Left all channels.', 'parse_as': 'PART'}
|
return {'channels': oldchans, 'text': 'Left all channels.', 'parse_as': 'PART'}
|
||||||
|
|
||||||
|
else:
|
||||||
|
for channel in args[0].split(','):
|
||||||
|
# Normalize channel case.
|
||||||
|
channel = utils.toLower(self.irc, channel)
|
||||||
|
|
||||||
|
c = self.irc.channels[channel]
|
||||||
|
|
||||||
self.irc.users[numeric].channels.add(channel)
|
self.irc.users[numeric].channels.add(channel)
|
||||||
self.irc.channels[channel].users.add(numeric)
|
self.irc.channels[channel].users.add(numeric)
|
||||||
# Call hooks manually, because one JOIN command in UnrealIRCd can
|
# Call hooks manually, because one JOIN command in UnrealIRCd can
|
||||||
|
Loading…
Reference in New Issue
Block a user