diff options
author | George Hazan <george.hazan@gmail.com> | 2025-04-16 19:35:37 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2025-04-16 19:35:37 +0300 |
commit | d35fdfd4681f12a616ce51eb820e960469039e74 (patch) | |
tree | b5aea542f2b5e86651e708567139cc6f24ab2a3a /src | |
parent | 9f27827e9b6cb1462ec4c5e306ae7eec79ba6473 (diff) |
also restored old code for group's deletion
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/clistgroups.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp index 41778fda45..e6547cd2f1 100644 --- a/src/mir_app/src/clistgroups.cpp +++ b/src/mir_app/src/clistgroups.cpp @@ -257,10 +257,12 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup, bool bSilent) for (auto &it : arByIds)
it->oldId = it->groupId;
+ int iGap = 0;
for (auto &it : arByIds.rev_iter()) {
if (!isParentOf(wszOldName, it->groupName))
continue;
+ iGap++;
arByName.remove(it);
arByIds.removeItem(&it);
}
@@ -271,6 +273,12 @@ MIR_APP_DLL(int) Clist_GroupDelete(MGROUP hGroup, bool bSilent) it->save();
}
+ for (int i = 0; i < iGap; i++) {
+ char idstr[33];
+ _itoa(arByIds.getCount() + i, idstr, 10);
+ db_unset(0, GROUPS_MODULE, idstr);
+ }
+
SetCursor(LoadCursor(nullptr, IDC_ARROW));
Clist_LoadContactTree();
Clist_BroadcastAsync(INTM_GROUPSCHANGED, 0, 0);
|