From e7ae6ddbff17dfa30805db25acd9722554c060c9 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 17 Jul 2016 23:09:11 -0700 Subject: [PATCH] clientbot: in conditionals, don't break if irc.pseudoclient isn't set yet --- protocols/clientbot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index d27b78f..07c90d7 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -32,7 +32,7 @@ class ClientbotWrapperProtocol(Protocol): """ Formats text with the given sender as a prefix. """ - if source == self.irc.pseudoclient.uid: + if self.irc.pseudoclient and source == self.irc.pseudoclient.uid: return text else: # TODO: configurable formatting @@ -100,7 +100,7 @@ class ClientbotWrapperProtocol(Protocol): self.irc.users[client].channels.add(channel) # Only joins for the main PyLink client are actually forwarded. Others are ignored. - if client == self.irc.pseudoclient.uid: + if self.irc.pseudoclient and client == self.irc.pseudoclient.uid: self.irc.send('JOIN %s' % channel) else: log.debug('(%s) join: faking JOIN of client %s/%s to %s', self.irc.name, client, @@ -143,7 +143,7 @@ class ClientbotWrapperProtocol(Protocol): self.irc.users[source].channels.discard(channel) # Only parts for the main PyLink client are actually forwarded. Others are ignored. - if source == self.irc.pseudoclient.uid: + if self.irc.pseudoclient and source == self.irc.pseudoclient.uid: self.irc.send('PART %s :%s' % (channel, reason)) def quit(self, source, reason):