Changeset 9045
- Timestamp:
- 11/24/07 10:48:38 (12 months ago)
- Files:
-
- 1 modified
-
trunk/src/common/contacts.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/contacts.py
r9044 r9045 433 433 show_list = ['not in roster', 'error', 'offline', 'invisible', 'dnd', 434 434 'xa', 'away', 'chat', 'online', 'requested', 'message'] 435 show1 = show_list.index(contact1.show) 436 show2 = show_list.index(contact2.show) 435 # contact can be null when we fill the roster on connection 436 if not contact1: 437 show1 = 0 438 priority1 = 0 439 else: 440 show1 = show_list.index(contact1.show) 441 priority1 = contact1.priority 442 if not contact1: 443 show2 = 0 444 priority2 = 0 445 else: 446 show2 = show_list.index(contact2.show) 447 priority2 = contact2.priority 437 448 # If only one is offline, it's always second 438 449 if show1 > 2 and show2 < 3: … … 451 462 if transport1 and not transport2: 452 463 return -1 453 if contact1.priority > contact2.priority:464 if priority1 > priority2: 454 465 return 1 455 if contact2.priority > contact1.priority:466 if priority2 > priority1: 456 467 return -1 457 468 if show1 > show2:
