group functionality fixes from storage engine; tor status include percent; crate group enhancement #265

Merged
sarah merged 5 commits from groupFixes into trunk 2021-12-18 21:28:29 +00:00
1 changed files with 8 additions and 0 deletions
Showing only changes of commit 75acfe8dd0 - Show all commits

View File

@ -149,6 +149,7 @@ class ContactListState extends ChangeNotifier {
servers?.addGroup(contact);
}
});
resort();
notifyListeners();
}
@ -157,6 +158,7 @@ class ContactListState extends ChangeNotifier {
if (newContact.isGroup) {
servers?.addGroup(newContact);
}
resort();
notifyListeners();
}
@ -164,12 +166,18 @@ class ContactListState extends ChangeNotifier {
_contacts.sort((ContactInfoState a, ContactInfoState b) {
// return -1 = a first in list
// return 1 = b first in list
// blocked contacts last
if (a.isBlocked == true && b.isBlocked != true) return 1;
if (a.isBlocked != true && b.isBlocked == true) return -1;
// archive is next...
if (!a.isArchived && b.isArchived) return -1;
if (a.isArchived && !b.isArchived) return 1;
// unapproved top
if (a.isInvitation && !b.isInvitation) return -1;
if (!a.isInvitation && b.isInvitation) return 1;
// special sorting for contacts with no messages in either history
if (a.lastMessageTime.millisecondsSinceEpoch == 0 && b.lastMessageTime.millisecondsSinceEpoch == 0) {
// online contacts first