prevent traceback when a room is destroyed. Fixes #5194
This commit is contained in:
		
							parent
							
								
									2ffd6cbcb8
								
							
						
					
					
						commit
						f501c2c4fe
					
				
					 1 changed files with 7 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -2329,12 +2329,13 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
 | 
			
		|||
					r = destroy.getTagData('reason')
 | 
			
		||||
					if r:
 | 
			
		||||
						reason += ' (%s)' % r
 | 
			
		||||
					try:
 | 
			
		||||
						jid = helpers.parse_jid(destroy.getAttr('jid'))
 | 
			
		||||
					except common.helpers.InvalidFormat:
 | 
			
		||||
						pass
 | 
			
		||||
					if jid:
 | 
			
		||||
						reason += '\n' + _('You can join this room instead: %s') % jid
 | 
			
		||||
					if destroy.getAttr('jid'):
 | 
			
		||||
						try:
 | 
			
		||||
							jid = helpers.parse_jid(destroy.getAttr('jid'))
 | 
			
		||||
							reason += '\n' + _('You can join this room instead: %s') \
 | 
			
		||||
								% jid
 | 
			
		||||
						except common.helpers.InvalidFormat:
 | 
			
		||||
							pass
 | 
			
		||||
					statusCode = ['destroyed']
 | 
			
		||||
				else:
 | 
			
		||||
					reason = prs.getReason()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue