Changeset 9044
- Timestamp:
- 11/23/07 21:54:25 (13 months ago)
- Files:
-
- 1 modified
-
trunk/src/common/contacts.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/contacts.py
r9043 r9044 425 425 Data is {'jid': jid, 'account': account, 'order': order} 426 426 order is optional''' 427 jid1 = data1['jid'] 428 jid2 = data2['jid'] 429 account1 = data1['account'] 430 account2 = data2['account'] 431 contact1 = self.get_contact_with_highest_priority(account1, jid1) 432 contact2 = self.get_contact_with_highest_priority(account2, jid2) 433 show_list = ['not in roster', 'error', 'offline', 'invisible', 'dnd', 434 'xa', 'away', 'chat', 'online', 'requested', 'message'] 435 show1 = show_list.index(contact1.show) 436 show2 = show_list.index(contact2.show) 437 # If only one is offline, it's always second 438 if show1 > 2 and show2 < 3: 439 return 1 440 if show2 > 2 and show1 < 3: 441 return -1 427 442 if 'order' in data1 and 'order' in data2: 428 443 if data1['order'] > data2['order']: … … 430 445 if data1['order'] < data2['order']: 431 446 return -1 432 jid1 = data1['jid']433 jid2 = data2['jid']434 447 transport1 = common.gajim.get_transport_name_from_jid(jid1) 435 448 transport2 = common.gajim.get_transport_name_from_jid(jid2) … … 438 451 if transport1 and not transport2: 439 452 return -1 440 contact1 = self.get_contact_with_highest_priority(data1['account'], jid1)441 contact2 = self.get_contact_with_highest_priority(data2['account'], jid2)442 453 if contact1.priority > contact2.priority: 443 454 return 1 444 455 if contact2.priority > contact1.priority: 445 456 return -1 446 show_list = ['not in roster', 'error', 'offline', 'invisible', 'dnd',447 'xa', 'away', 'chat', 'online', 'requested', 'message']448 show1 = show_list.index(contact1.show)449 show2 = show_list.index(contact2.show)450 457 if show1 > show2: 451 458 return 1 … … 457 464 return -1 458 465 # If all is the same, compare accounts, they can't be the same 459 account1 = data1['account']460 account2 = data2['account']461 466 if account1 > account2: 462 467 return 1
