mirror of
				https://github.com/jlu5/PyLink.git
				synced 2025-11-04 08:57:25 +01:00 
			
		
		
		
	inspircd: work around extraneous letters sometimes sent in FJOIN TS
Anope 1.8 potentially sends a trailing 'd' after the timestamp, which causes int() to error. This is technically valid in InspIRCd S2S because atoi() ignores non-digit characters, but it's strange behaviour either way: <- :3AX FJOIN #monitor 1485462109d + :,3AXAAAAAK Thansk to @koaxirc for reporting. (cherry picked from commit 663e657bf5a82d9c2d1a1f3e9a02709118dc796b)
This commit is contained in:
		
							parent
							
								
									0d99bc62d2
								
							
						
					
					
						commit
						f7768a00a0
					
				@ -539,8 +539,13 @@ class InspIRCdProtocol(TS6BaseProtocol):
 | 
			
		||||
 | 
			
		||||
            self.irc.channels[channel].users.add(user)
 | 
			
		||||
 | 
			
		||||
        # Statekeeping with timestamps
 | 
			
		||||
        their_ts = int(args[1])
 | 
			
		||||
        # Statekeeping with timestamps. Note: some service packages (Anope 1.8) send a trailing
 | 
			
		||||
        # 'd' after the timestamp, which we should strip out to prevent int() from erroring.
 | 
			
		||||
        # This is technically valid in InspIRCd S2S because atoi() ignores non-digit characters,
 | 
			
		||||
        # but it's strange behaviour either way...
 | 
			
		||||
        # <- :3AX FJOIN #monitor 1485462109d + :,3AXAAAAAK
 | 
			
		||||
        their_ts = int(''.join(char for char in args[1] if char.isdigit()))
 | 
			
		||||
 | 
			
		||||
        our_ts = self.irc.channels[channel].ts
 | 
			
		||||
        self.updateTS(servernumeric, channel, their_ts, changedmodes)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user