summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/clistgroups.cpp8
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);