summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/clc.cpp10
-rw-r--r--src/mir_app/src/clistgroups.cpp2
-rw-r--r--src/mir_app/src/menu_groups.cpp4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp
index 1a02e1f04c..b19d169efa 100644
--- a/src/mir_app/src/clc.cpp
+++ b/src/mir_app/src/clc.cpp
@@ -1244,6 +1244,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
hit = cli.pfnGetRowByIndex(dat, dat->selection, &contact, NULL);
if (hit == -1)
break;
+
if (contact->type == CLCIT_CONTACT)
if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), contact->hContact))
break;
@@ -1251,21 +1252,18 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
if (contact->type == CLCIT_GROUP) {
switch (LOWORD(wParam)) {
case POPUP_NEWSUBGROUP:
- if (contact->type != CLCIT_GROUP)
- break;
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~CLS_HIDEEMPTYGROUPS);
+ SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_USEGROUPS);
Clist_GroupCreate(contact->groupId, 0);
break;
case POPUP_RENAMEGROUP:
cli.pfnBeginRenameSelection(hwnd, dat);
break;
case POPUP_DELETEGROUP:
- if (contact->type == CLCIT_GROUP)
- Clist_GroupDelete(contact->groupId);
+ Clist_GroupDelete(contact->groupId);
break;
case POPUP_GROUPHIDEOFFLINE:
- if (contact->type == CLCIT_GROUP)
- Clist_GroupSetFlags(contact->groupId, MAKELPARAM(contact->group->hideOffline ? 0 : GROUPF_HIDEOFFLINE, GROUPF_HIDEOFFLINE));
+ Clist_GroupSetFlags(contact->groupId, MAKELPARAM(contact->group->hideOffline ? 0 : GROUPF_HIDEOFFLINE, GROUPF_HIDEOFFLINE));
break;
}
diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp
index 08c377b681..dd4d23571a 100644
--- a/src/mir_app/src/clistgroups.cpp
+++ b/src/mir_app/src/clistgroups.cpp
@@ -128,9 +128,9 @@ static INT_PTR CreateGroupInternal(MGROUP hParent, const TCHAR *ptszName)
int newId = arByIds.getCount();
newName[0] = 1 | GROUPF_EXPANDED; // 1 is required so we never get '\0'
CGroupInternal *pNew = new CGroupInternal(newId, newName);
- pNew->save();
arByIds.insert(pNew);
arByName.insert(pNew);
+ pNew->save();
Clist_GroupAdded(newId + 1);
diff --git a/src/mir_app/src/menu_groups.cpp b/src/mir_app/src/menu_groups.cpp
index 58efbff0b7..1eda0aa080 100644
--- a/src/mir_app/src/menu_groups.cpp
+++ b/src/mir_app/src/menu_groups.cpp
@@ -214,6 +214,7 @@ static INT_PTR SubGroupMenuCheckService(WPARAM wParam, LPARAM)
// called with:
// wparam - ownerdata
// lparam - lparam from winproc
+
static INT_PTR SubGroupMenuExecService(WPARAM wParam, LPARAM lParam)
{
if (wParam != 0) {
@@ -255,6 +256,7 @@ static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
// wparam menu handle to pass to clc.c
// lparam WM_COMMAND HWND
+
static INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM lParam)
{
SendMessage(lParam ? (HWND)lParam : (HWND)cli.hwndContactTree, WM_COMMAND, wParam, 0);
@@ -330,7 +332,6 @@ void InitGroupMenus(void)
CreateServiceFunction("CLISTMENUSSubGroup/ExecService", SubGroupMenuExecService);
CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu", FreeOwnerDataSubGroupMenu);
CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuCheckService", SubGroupMenuCheckService);
- CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy", GroupMenuExecProxy);
hEventPreBuildSubGroupMenu = CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
@@ -349,6 +350,7 @@ void InitGroupMenus(void)
mi.name.a = LPGEN("&New subgroup");
gmp.wParam = POPUP_NEWSUBGROUP;
Menu_AddSubGroupMenuItem(&mi, &gmp);
+ CreateServiceFunction(mi.pszService, GroupMenuExecProxy);
SET_UID(mi, 0xd85f5ff0, 0x12ca, 0x464d, 0x86, 0x51, 0x53, 0x36, 0x9f, 0x1d, 0x80, 0x45);
mi.position = 1001;