mirror of
				https://github.com/jlu5/PyLink.git
				synced 2025-11-04 00:47:21 +01:00 
			
		
		
		
	protocols: catch S2S messages if they're being routed the wrong way (#405)
This commit is contained in:
		
							parent
							
								
									2f968aca80
								
							
						
					
					
						commit
						f1fddefeac
					
				@ -846,6 +846,10 @@ class P10Protocol(IRCS2SProtocol):
 | 
			
		||||
            return
 | 
			
		||||
 | 
			
		||||
        else:  # Send a hook with the hook arguments given by the handler function.
 | 
			
		||||
            if self.irc.isInternalClient(sender) or self.irc.isInternalServer(sender):
 | 
			
		||||
                log.warning("(%s) Received command %s being routed the wrong way!", self.irc.name, command)
 | 
			
		||||
                return
 | 
			
		||||
 | 
			
		||||
            parsed_args = func(sender, command, args)
 | 
			
		||||
            if parsed_args is not None:
 | 
			
		||||
                return [sender, command, parsed_args]
 | 
			
		||||
 | 
			
		||||
@ -330,6 +330,10 @@ class TS6BaseProtocol(IRCS2SProtocol):
 | 
			
		||||
            command = args[0]
 | 
			
		||||
            args = args[1:]
 | 
			
		||||
 | 
			
		||||
        if self.irc.isInternalClient(numeric) or self.irc.isInternalServer(numeric):
 | 
			
		||||
            log.warning("(%s) Received command %s being routed the wrong way!", self.irc.name, command)
 | 
			
		||||
            return
 | 
			
		||||
 | 
			
		||||
        if command == 'ENCAP':
 | 
			
		||||
            # Special case for encapsulated commands (ENCAP), in forms like this:
 | 
			
		||||
            # <- :00A ENCAP * SU 42XAAAAAC :GLolol
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user