mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-24 03:04:05 +01:00
fix some bugs, introduce others
This commit is contained in:
parent
c0f82597a5
commit
ea7681502f
@ -592,13 +592,14 @@ def relayJoins(irc, channel, users, ts, modes):
|
|||||||
# meaningless.
|
# meaningless.
|
||||||
continue
|
continue
|
||||||
log.debug('Okay, spawning %s/%s everywhere', user, irc.name)
|
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)
|
u = getRemoteUser(irc, remoteirc, user)
|
||||||
ts = irc.channels[channel].ts
|
ts = irc.channels[channel].ts
|
||||||
# TODO: join users in batches with SJOIN, not one by one.
|
# TODO: join users in batches with SJOIN, not one by one.
|
||||||
prefixes = getPrefixModes(irc, remoteirc, channel, user)
|
prefixes = getPrefixModes(irc, remoteirc, channel, user)
|
||||||
userpair = (prefixes, u)
|
userpair = (prefixes, u)
|
||||||
queued_users.append(userpair)
|
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)
|
remoteirc.proto.sjoinServer(remoteirc, remoteirc.sid, remotechan, queued_users, ts=ts)
|
||||||
relayModes(irc, remoteirc, irc.sid, channel, modes)
|
relayModes(irc, remoteirc, irc.sid, channel, modes)
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ def handle_part(irc, source, command, args):
|
|||||||
return {'channels': channels, 'text': reason}
|
return {'channels': channels, 'text': reason}
|
||||||
|
|
||||||
def handle_error(irc, numeric, command, args):
|
def handle_error(irc, numeric, command, args):
|
||||||
irc.connected = False
|
irc.connected.clear()
|
||||||
raise ProtocolError('Received an ERROR, killing!')
|
raise ProtocolError('Received an ERROR, killing!')
|
||||||
|
|
||||||
def handle_fjoin(irc, servernumeric, command, args):
|
def handle_fjoin(irc, servernumeric, command, args):
|
||||||
|
@ -87,7 +87,11 @@ def sjoinServer(irc, server, channel, users, ts=None):
|
|||||||
for userpair in users:
|
for userpair in users:
|
||||||
assert len(userpair) == 2, "Incorrect format of userpair: %r" % userpair
|
assert len(userpair) == 2, "Incorrect format of userpair: %r" % userpair
|
||||||
prefixes, user = 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)
|
namelist.append(prefixchars+user)
|
||||||
uids.append(user)
|
uids.append(user)
|
||||||
for m in prefixes:
|
for m in prefixes:
|
||||||
|
Loading…
Reference in New Issue
Block a user