Corrected return values of zeroconf client in order to return true-evaluable values. related to #4051
This commit is contained in:
		
							parent
							
								
									9c3c70ad7b
								
							
						
					
					
						commit
						2712786383
					
				
					 2 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -703,7 +703,7 @@ class ClientZeroconf:
 | 
			
		|||
			if conn.add_stanza(stanza, is_message):
 | 
			
		||||
				if on_ok:
 | 
			
		||||
					on_ok()
 | 
			
		||||
				return 0
 | 
			
		||||
				return id
 | 
			
		||||
 | 
			
		||||
		if item['address'] in self.ip_to_hash:
 | 
			
		||||
			hash = self.ip_to_hash[item['address']]
 | 
			
		||||
| 
						 | 
				
			
			@ -714,7 +714,7 @@ class ClientZeroconf:
 | 
			
		|||
				if conn.add_stanza(stanza, is_message):
 | 
			
		||||
					if on_ok:
 | 
			
		||||
						on_ok()
 | 
			
		||||
					return 0
 | 
			
		||||
					return id
 | 
			
		||||
 | 
			
		||||
		# otherwise open new connection
 | 
			
		||||
		stanza.setID('zero')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -462,6 +462,7 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
 | 
			
		|||
		if ret == -1:
 | 
			
		||||
			# Contact Offline
 | 
			
		||||
			self.dispatch('MSGERROR', [jid, '-1', _('Contact is offline. Your message could not be sent.'), None, None, session])
 | 
			
		||||
		return ret
 | 
			
		||||
 | 
			
		||||
	def send_stanza(self, stanza):
 | 
			
		||||
		# send a stanza untouched
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue