Changeset 9027 for branches/gajim_0.11.3-bugfixes/src/common/contacts.py
- Timestamp:
- 11/21/07 09:44:25 (12 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11.3-bugfixes/src/common/contacts.py
r9019 r9027 390 390 Data is {'jid': jid, 'account': account, 'order': order} 391 391 order is optional''' 392 jid1 = data1['jid'] 393 jid2 = data2['jid'] 394 account1 = data1['account'] 395 account2 = data2['account'] 396 contact1 = self.get_contact_with_highest_priority(account1, jid1) 397 contact2 = self.get_contact_with_highest_priority(account2, jid2) 398 show_list = ['not in roster', 'error', 'offline', 'invisible', 'dnd', 399 'xa', 'away', 'chat', 'online', 'requested', 'message'] 400 show1 = show_list.index(contact1.show) 401 show2 = show_list.index(contact2.show) 402 # If only one is offline, it's always second 403 if show1 > 2 and show2 < 3: 404 return 1 405 if show2 > 2 and show1 < 3: 406 return -1 392 407 if 'order' in data1 and 'order' in data2: 393 408 if data1['order'] > data2['order']: … … 395 410 if data1['order'] < data2['order']: 396 411 return -1 397 jid1 = data1['jid']398 jid2 = data2['jid']399 412 transport1 = common.gajim.get_transport_name_from_jid(jid1) 400 413 transport2 = common.gajim.get_transport_name_from_jid(jid2) … … 403 416 if transport1 and not transport2: 404 417 return -1 405 contact1 = self.get_contact_with_highest_priority(data1['account'], jid1)406 contact2 = self.get_contact_with_highest_priority(data2['account'], jid2)407 418 if contact1.priority > contact2.priority: 408 419 return 1 409 420 if contact2.priority > contact1.priority: 410 421 return -1 411 show_list = ['not in roster', 'error', 'offline', 'invisible', 'dnd',412 'xa', 'away', 'chat', 'online', 'requested', 'message']413 show1 = show_list.index(contact1.show)414 show2 = show_list.index(contact2.show)415 422 if show1 > show2: 416 423 return 1 … … 422 429 return -1 423 430 # If all is the same, compare accounts, they can't be the same 424 account1 = data1['account']425 account2 = data2['account']426 431 if account1 > account2: 427 432 return 1
