mirror of
				https://github.com/jlu5/PyLink.git
				synced 2025-11-04 00:47:21 +01:00 
			
		
		
		
	clientbot: in conditionals, don't break if irc.pseudoclient isn't set yet
This commit is contained in:
		
							parent
							
								
									de618393c0
								
							
						
					
					
						commit
						e7ae6ddbff
					
				@ -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):
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user