handle message receipts corretly, even if they don't have the <thread> element
This commit is contained in:
		
							parent
							
								
									47a7c0506a
								
							
						
					
					
						commit
						8d37cec3b0
					
				
					 1 changed files with 15 additions and 7 deletions
				
			
		| 
						 | 
					@ -1194,13 +1194,21 @@ class ConnectionHandlersBase:
 | 
				
			||||||
            self.connection.send(receipt)
 | 
					            self.connection.send(receipt)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # We got our message's receipt
 | 
					        # We got our message's receipt
 | 
				
			||||||
        if obj.receipt_received_tag and obj.session.control and \
 | 
					        if obj.receipt_received_tag and gajim.config.get_per('accounts',
 | 
				
			||||||
        gajim.config.get_per('accounts', self.name, 'request_receipt'):
 | 
					        self.name, 'request_receipt'):
 | 
				
			||||||
            id_ = obj.receipt_received_tag.getAttr('id')
 | 
					            ctrl = obj.session.control
 | 
				
			||||||
            if not id_:
 | 
					            if not ctrl:
 | 
				
			||||||
                # old XEP implementation
 | 
					                # Received <message> doesn't have the <thread> element?
 | 
				
			||||||
                id_ = obj.id_
 | 
					                # search in all sessions
 | 
				
			||||||
            obj.session.control.conv_textview.hide_xep0184_warning(id_)
 | 
					                for s in self.get_sessions(obj.jid):
 | 
				
			||||||
 | 
					                    if s.control:
 | 
				
			||||||
 | 
					                        ctrl = s.control
 | 
				
			||||||
 | 
					            if ctrl:
 | 
				
			||||||
 | 
					                id_ = obj.receipt_received_tag.getAttr('id')
 | 
				
			||||||
 | 
					                if not id_:
 | 
				
			||||||
 | 
					                    # old XEP implementation
 | 
				
			||||||
 | 
					                    id_ = obj.id_
 | 
				
			||||||
 | 
					                ctrl.conv_textview.hide_xep0184_warning(id_)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if obj.mtype == 'error':
 | 
					        if obj.mtype == 'error':
 | 
				
			||||||
            if not obj.msgtxt:
 | 
					            if not obj.msgtxt:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue