when we compare 2 offline contacts, the one which has a status messages is shown above the one without. fixes #3010
This commit is contained in:
		
							parent
							
								
									607f13747e
								
							
						
					
					
						commit
						019f43fa38
					
				
					 2 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
					@ -405,6 +405,9 @@ class Contacts:
 | 
				
			||||||
				score += contact.priority * 10
 | 
									score += contact.priority * 10
 | 
				
			||||||
		score += ['not in roster', 'error', 'offline', 'invisible', 'dnd', 'xa',
 | 
							score += ['not in roster', 'error', 'offline', 'invisible', 'dnd', 'xa',
 | 
				
			||||||
		'away', 'chat', 'online', 'requested', 'message'].index(contact.show)
 | 
							'away', 'chat', 'online', 'requested', 'message'].index(contact.show)
 | 
				
			||||||
 | 
							if contact.show == 'offline' and contact.status:
 | 
				
			||||||
 | 
								# Offline contacts with a status message have highest score
 | 
				
			||||||
 | 
								score += 1
 | 
				
			||||||
		return score
 | 
							return score
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def get_metacontacts_big_brother(self, family):
 | 
						def get_metacontacts_big_brother(self, family):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3956,6 +3956,12 @@ class RosterWindow:
 | 
				
			||||||
				return -1
 | 
									return -1
 | 
				
			||||||
			elif show1 > show2:
 | 
								elif show1 > show2:
 | 
				
			||||||
				return 1
 | 
									return 1
 | 
				
			||||||
 | 
								if show1 == 6 and show2 == 6:
 | 
				
			||||||
 | 
									# If both are offline, and one has a status message, it is above
 | 
				
			||||||
 | 
									if contact1.status and not contact2.status:
 | 
				
			||||||
 | 
										return -1
 | 
				
			||||||
 | 
									elif contact2.status and not contact1.status:
 | 
				
			||||||
 | 
										return 1
 | 
				
			||||||
		# We compare names
 | 
							# We compare names
 | 
				
			||||||
		if name1.lower() < name2.lower():
 | 
							if name1.lower() < name2.lower():
 | 
				
			||||||
			return -1
 | 
								return -1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue