mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 21:19:31 +01:00
Fix joinModes, and use it in protocol/inspircd's joinClient
In short, PyLink should be sending FJOINs to channels with the modes that it already has (or what we believe it has). This prevents clearing mode lists when PyLink's channel TS is slightly earlier than the IRCd's.
This commit is contained in:
parent
170620c410
commit
74339d1038
@ -54,8 +54,9 @@ def joinClient(irc, client, channel):
|
||||
if not utils.isChannel(channel):
|
||||
raise ValueError('Invalid channel name %r.' % channel)
|
||||
# One channel per line here!
|
||||
_sendFromServer(irc, server, "FJOIN {channel} {ts} + :,{uid}".format(
|
||||
ts=int(time.time()), uid=client, channel=channel))
|
||||
_sendFromServer(irc, server, "FJOIN {channel} {ts} {modes} :,{uid}".format(
|
||||
ts=int(time.time()), uid=client, channel=channel,
|
||||
modes=utils.joinModes(irc.channels[channel].modes)))
|
||||
irc.channels[channel].users.add(client)
|
||||
|
||||
def partClient(irc, client, channel, reason=None):
|
||||
|
6
utils.py
6
utils.py
@ -195,10 +195,12 @@ def joinModes(modes):
|
||||
args = []
|
||||
for modepair in modes:
|
||||
mode, arg = modepair
|
||||
modelist += mode[1]
|
||||
modelist += mode
|
||||
if arg is not None:
|
||||
args.append(arg)
|
||||
s = '+%s %s' % (modelist, ' '.join(args))
|
||||
s = '+%s' % modelist
|
||||
if args:
|
||||
s += ' %s' % ' '.join(args)
|
||||
return s
|
||||
|
||||
def isInternalClient(irc, numeric):
|
||||
|
Loading…
Reference in New Issue
Block a user