diff options
Diffstat (limited to 'Swift/Controllers/Contact.cpp')
-rw-r--r-- | Swift/Controllers/Contact.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Swift/Controllers/Contact.cpp b/Swift/Controllers/Contact.cpp index 198443d..be2b83a 100644 --- a/Swift/Controllers/Contact.cpp +++ b/Swift/Controllers/Contact.cpp @@ -18,9 +18,17 @@ Contact::Contact(const std::string& name, const JID& jid, StatusShow::Type statu bool Contact::lexicographicalSortPredicate(const Contact::ref& a, const Contact::ref& b) { + if (a->jid.isValid() && b->jid.isValid()) { return a->jid < b->jid; + } else { + return a->name < b->name; + } } bool Contact::equalityPredicate(const Contact::ref& a, const Contact::ref& b) { + if (a->jid.isValid() && b->jid.isValid()) { return a->jid == b->jid; + } else { + return a->name == b->name; + } } |