mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-24 11:39:25 +01:00
clientbot: don't update state on join()
Wait for NAMES instead to make sure that the join attempt actually succeeded. #299
This commit is contained in:
parent
7a0a013c43
commit
3a0a2c7f1c
@ -122,15 +122,17 @@ class ClientbotWrapperProtocol(Protocol):
|
|||||||
"""STUB: Joins a user to a channel."""
|
"""STUB: Joins a user to a channel."""
|
||||||
channel = self.irc.toLower(channel)
|
channel = self.irc.toLower(channel)
|
||||||
|
|
||||||
self.irc.channels[channel].users.add(client)
|
|
||||||
self.irc.users[client].channels.add(channel)
|
|
||||||
|
|
||||||
# Only joins for the main PyLink client are actually forwarded. Others are ignored.
|
# Only joins for the main PyLink client are actually forwarded. Others are ignored.
|
||||||
|
# Note: we do not automatically add our main client to the channel state, as we
|
||||||
|
# rely on the /NAMES reply to sync it up properly.
|
||||||
if self.irc.pseudoclient and client == self.irc.pseudoclient.uid:
|
if self.irc.pseudoclient and client == self.irc.pseudoclient.uid:
|
||||||
self.irc.send('JOIN %s' % channel)
|
self.irc.send('JOIN %s' % channel)
|
||||||
# Send a /who request right after
|
# Send a /who request right after
|
||||||
self.irc.send('WHO %s' % channel)
|
self.irc.send('WHO %s' % channel)
|
||||||
else:
|
else:
|
||||||
|
self.irc.channels[channel].users.add(client)
|
||||||
|
self.irc.users[client].channels.add(channel)
|
||||||
|
|
||||||
log.debug('(%s) join: faking JOIN of client %s/%s to %s', self.irc.name, client,
|
log.debug('(%s) join: faking JOIN of client %s/%s to %s', self.irc.name, client,
|
||||||
self.irc.getFriendlyName(client), channel)
|
self.irc.getFriendlyName(client), channel)
|
||||||
self.irc.callHooks([client, 'CLIENTBOT_JOIN', {'channel': channel}])
|
self.irc.callHooks([client, 'CLIENTBOT_JOIN', {'channel': channel}])
|
||||||
|
Loading…
Reference in New Issue
Block a user