3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

Merge branch 'master' into devel

This commit is contained in:
James Lu 2015-08-26 14:59:22 -07:00
commit ab4cb4d895
2 changed files with 12 additions and 12 deletions

View File

@ -407,7 +407,8 @@ def handle_fjoin(irc, servernumeric, command, args):
modeprefix, user = user.split(',', 1)
namelist.append(user)
irc.users[user].channels.add(channel)
utils.applyModes(irc, channel, [('+%s' % mode, user) for mode in modeprefix])
if their_ts <= our_ts:
utils.applyModes(irc, channel, [('+%s' % mode, user) for mode in modeprefix])
irc.channels[channel].users.add(user)
return {'channel': channel, 'users': namelist, 'modes': parsedmodes, 'ts': their_ts}
@ -563,21 +564,20 @@ def handle_events(irc, data):
irc.connected.set()
try:
real_args = []
for arg in args:
for idx, arg in enumerate(args):
real_args.append(arg)
# If the argument starts with ':' and ISN'T the first argument.
# The first argument is used for denoting the source UID/SID.
if arg.startswith(':') and args.index(arg) != 0:
if arg.startswith(':') and idx != 0:
# : is used for multi-word arguments that last until the end
# of the message. We can use list splicing here to turn them all
# into one argument.
index = args.index(arg) # Get the array index of the multi-word arg
# Set the last arg to a joined version of the remaining args
arg = args[index:]
arg = args[idx:]
arg = ' '.join(arg)[1:]
# Cut the original argument list right before the multi-word arg,
# and then append the multi-word arg.
real_args = args[:index]
real_args = args[:idx]
real_args.append(arg)
break
real_args[0] = real_args[0].split(':', 1)[1]

View File

@ -422,7 +422,8 @@ def handle_sjoin(irc, servernumeric, command, args):
finalprefix += char
namelist.append(user)
irc.users[user].channels.add(channel)
utils.applyModes(irc, channel, [('+%s' % mode, user) for mode in finalprefix])
if their_ts <= our_ts:
utils.applyModes(irc, channel, [('+%s' % mode, user) for mode in finalprefix])
irc.channels[channel].users.add(user)
return {'channel': channel, 'users': namelist, 'modes': parsedmodes, 'ts': their_ts}
@ -564,21 +565,20 @@ def handle_events(irc, data):
endburst_timer.start()
try:
real_args = []
for arg in args:
for idx, arg in enumerate(args):
real_args.append(arg)
# If the argument starts with ':' and ISN'T the first argument.
# The first argument is used for denoting the source UID/SID.
if arg.startswith(':') and args.index(arg) != 0:
if arg.startswith(':') and idx != 0:
# : is used for multi-word arguments that last until the end
# of the message. We can use list splicing here to turn them all
# into one argument.
index = args.index(arg) # Get the array index of the multi-word arg
# Set the last arg to a joined version of the remaining args
arg = args[index:]
arg = args[idx:]
arg = ' '.join(arg)[1:]
# Cut the original argument list right before the multi-word arg,
# and then append the multi-word arg.
real_args = args[:index]
real_args = args[:idx]
real_args.append(arg)
break
real_args[0] = real_args[0].split(':', 1)[1]