Find correct contact on private message
get_contact() returns also a contact if only the bare jid matches, which for private messages is the groupchat contact object.
This commit is contained in:
		
							parent
							
								
									1c09b50791
								
							
						
					
					
						commit
						5af7967127
					
				
					 1 changed files with 7 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -79,11 +79,13 @@ class ChatControlSession:
 | 
			
		|||
        """
 | 
			
		||||
        if obj.session != self:
 | 
			
		||||
            return
 | 
			
		||||
        contact = app.contacts.get_contact(self.conn.name, obj.jid,
 | 
			
		||||
            obj.resource)
 | 
			
		||||
        if not contact:
 | 
			
		||||
            contact = app.contacts.get_gc_contact(self.conn.name, obj.jid,
 | 
			
		||||
                obj.resource)
 | 
			
		||||
 | 
			
		||||
        if obj.muc_pm:
 | 
			
		||||
            contact = app.contacts.get_gc_contact(
 | 
			
		||||
                self.conn.name, obj.jid, obj.resource)
 | 
			
		||||
        else:
 | 
			
		||||
            contact = app.contacts.get_contact(
 | 
			
		||||
                self.conn.name, obj.jid, obj.resource)
 | 
			
		||||
        if self.resource != obj.resource:
 | 
			
		||||
            self.resource = obj.resource
 | 
			
		||||
            if self.control:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue