mirror of
				https://github.com/jlu5/PyLink.git
				synced 2025-11-04 00:47:21 +01:00 
			
		
		
		
	relay: improve fallback KNOCK notices
- Show the network that the /knock originated from (it is *not* obvious when we have a user with no relay client) - Specifically hint that users with no relay client cannot be invited directly because there is no client to actually /invite! - Prefer sending the notice to %#channel when halfops are available, as they usually have the power to /invite
This commit is contained in:
		
							parent
							
								
									f64976b1ed
								
							
						
					
					
						commit
						d01b9aaa23
					
				@ -1984,8 +1984,13 @@ def handle_knock(irc, source, command, args):
 | 
			
		||||
 | 
			
		||||
        # Fallback to a simple notice directed to ops
 | 
			
		||||
        if use_fallback:
 | 
			
		||||
            remoteirc.notice(remoteirc.pseudoclient.uid, '@' + remotechan,
 | 
			
		||||
                             "Knock from %s: %s" % (irc.get_friendly_name(source), text))
 | 
			
		||||
            nick = irc.get_friendly_name(source)
 | 
			
		||||
            log.debug('(%s) relay: using fallback KNOCK routine for %s on %s/%s',
 | 
			
		||||
                      irc.name, nick, remoteirc.name, remotechan)
 | 
			
		||||
            prefix = '%' if 'h' in remoteirc.prefixmodes else '@'
 | 
			
		||||
            remoteirc.notice(remoteirc.pseudoclient.uid, prefix + remotechan,
 | 
			
		||||
                             "Knock from %s@%s (*not* invitable from this network): %s" %
 | 
			
		||||
                             (nick, irc.name, text))
 | 
			
		||||
 | 
			
		||||
    iterate_all(irc, _handle_knock_loop, extra_args=(source, command, args))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user