3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-23 18:54:05 +01:00

fix some bugs, introduce others

This commit is contained in:
James Lu 2015-07-21 17:33:36 -07:00
parent c0f82597a5
commit ea7681502f
3 changed files with 8 additions and 3 deletions

View File

@ -592,13 +592,14 @@ def relayJoins(irc, channel, users, ts, modes):
# meaningless.
continue
log.debug('Okay, spawning %s/%s everywhere', user, irc.name)
assert user in irc.users, "(%s) How is this possible? %r isn't in our user database." % (irc.name, user)
u = getRemoteUser(irc, remoteirc, user)
ts = irc.channels[channel].ts
# TODO: join users in batches with SJOIN, not one by one.
prefixes = getPrefixModes(irc, remoteirc, channel, user)
userpair = (prefixes, u)
queued_users.append(userpair)
log.debug('(%s) relayJoin: joining %s to %s%s', irc.name, userpair, remoteirc.name, remotechan)
log.debug('(%s) relayJoins: joining %s to %s%s', irc.name, userpair, remoteirc.name, remotechan)
remoteirc.proto.sjoinServer(remoteirc, remoteirc.sid, remotechan, queued_users, ts=ts)
relayModes(irc, remoteirc, irc.sid, channel, modes)

View File

@ -345,7 +345,7 @@ def handle_part(irc, source, command, args):
return {'channels': channels, 'text': reason}
def handle_error(irc, numeric, command, args):
irc.connected = False
irc.connected.clear()
raise ProtocolError('Received an ERROR, killing!')
def handle_fjoin(irc, servernumeric, command, args):

View File

@ -87,7 +87,11 @@ def sjoinServer(irc, server, channel, users, ts=None):
for userpair in users:
assert len(userpair) == 2, "Incorrect format of userpair: %r" % userpair
prefixes, user = userpair
prefixchars = ''.join([irc.prefixmodes[prefix] for prefix in prefixes])
prefixchars = ''
for prefix in prefixes:
pr = irc.prefixmodes.get(prefix)
if pr:
prefixchars += pr
namelist.append(prefixchars+user)
uids.append(user)
for m in prefixes: