mirror of
				https://github.com/jlu5/PyLink.git
				synced 2025-11-04 00:47:21 +01:00 
			
		
		
		
	unreal: ignore userpairs with only a prefix and no user
How is this even possible?! Reported by @koaxirc.
This commit is contained in:
		
							parent
							
								
									0b0efbaf9f
								
							
						
					
					
						commit
						9fac7cb1f3
					
				@ -617,12 +617,18 @@ class UnrealProtocol(TS6BaseProtocol):
 | 
			
		||||
            else:
 | 
			
		||||
                r = re.search(r'([^\w]*)(.*)', userpair)
 | 
			
		||||
                user = r.group(2)
 | 
			
		||||
 | 
			
		||||
                if not user:
 | 
			
		||||
                    # Userpair with no user? Ignore. XXX: find out how this is even possible...
 | 
			
		||||
                    # <- :002 SJOIN 1486361658 #idlerpg :@
 | 
			
		||||
                    continue
 | 
			
		||||
 | 
			
		||||
                user = self._getUid(user)  # Normalize nicks to UIDs for Unreal 3.2 links
 | 
			
		||||
                # Unreal uses slightly different prefixes in SJOIN. +q is * instead of ~,
 | 
			
		||||
                # and +a is ~ instead of &.
 | 
			
		||||
                modeprefix = (r.group(1) or '').replace("~", "&").replace("*", "~")
 | 
			
		||||
                finalprefix = ''
 | 
			
		||||
                assert user, 'Failed to get the UID from %r; our regex needs updating?' % userpair
 | 
			
		||||
 | 
			
		||||
                log.debug('(%s) handle_sjoin: got modeprefix %r for user %r', self.irc.name, modeprefix, user)
 | 
			
		||||
                for m in modeprefix:
 | 
			
		||||
                    # Iterate over the mapping of prefix chars to prefixes, and
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user