don't hide contact when other offline resource have pending events. fixes #2657
This commit is contained in:
		
							parent
							
								
									ed5930a1b1
								
							
						
					
					
						commit
						9ea82566d5
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
					@ -241,6 +241,11 @@ class RosterWindow:
 | 
				
			||||||
		model = self.tree.get_model()
 | 
							model = self.tree.get_model()
 | 
				
			||||||
		contact = gajim.contacts.get_first_contact_from_jid(account, jid)
 | 
							contact = gajim.contacts.get_first_contact_from_jid(account, jid)
 | 
				
			||||||
		nb_events = gajim.events.get_nb_roster_events(account, contact.jid)
 | 
							nb_events = gajim.events.get_nb_roster_events(account, contact.jid)
 | 
				
			||||||
 | 
							# count events from all resources
 | 
				
			||||||
 | 
							for contact_ in gajim.contacts.get_contact(account, jid):
 | 
				
			||||||
 | 
								if contact_.resource:
 | 
				
			||||||
 | 
									nb_events += gajim.events.get_nb_roster_events(account,
 | 
				
			||||||
 | 
										contact_.get_full_jid())
 | 
				
			||||||
		if not contact:
 | 
							if not contact:
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
		# If contact already in roster, do not add it
 | 
							# If contact already in roster, do not add it
 | 
				
			||||||
| 
						 | 
					@ -314,8 +319,7 @@ class RosterWindow:
 | 
				
			||||||
		if (contact.show in ('offline', 'error') or hide) and \
 | 
							if (contact.show in ('offline', 'error') or hide) and \
 | 
				
			||||||
		not showOffline and (not _('Transports') in contact.groups or \
 | 
							not showOffline and (not _('Transports') in contact.groups or \
 | 
				
			||||||
		gajim.connections[account].connected < 2) and \
 | 
							gajim.connections[account].connected < 2) and \
 | 
				
			||||||
		len(gajim.contacts.get_contact(account, jid)) == 1 and \
 | 
							len(gajim.contacts.get_contact(account, jid)) == 1 and nb_events == 0 and\
 | 
				
			||||||
		len(gajim.events.get_events(account, jid)) == 0 and \
 | 
					 | 
				
			||||||
		not _('Not in Roster') in contact.groups:
 | 
							not _('Not in Roster') in contact.groups:
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue