summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-10-15 13:44:59 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-10-15 13:44:59 +0300
commit71846dbe68eba2268751bebf0e2c2db8029cdd23 (patch)
treee98ca4177bcf5bc15e67d85cd87e009239342465
parenteb8648aa4e5ffed389904993be910b63b595fd6e (diff)
code cleaning
-rw-r--r--src/mir_app/src/clistevents.cpp10
-rw-r--r--src/mir_app/src/clistsettings.cpp6
-rw-r--r--src/mir_app/src/miranda.h6
3 files changed, 14 insertions, 8 deletions
diff --git a/src/mir_app/src/clistevents.cpp b/src/mir_app/src/clistevents.cpp
index bf66ff771f..9d7dd8708c 100644
--- a/src/mir_app/src/clistevents.cpp
+++ b/src/mir_app/src/clistevents.cpp
@@ -64,7 +64,7 @@ static int CompareEvents(const CListEvent *p1, const CListEvent *p2)
return p1->iOrder - p2->iOrder;
}
-OBJLIST<CListEvent> g_cliEvents(10, CompareEvents);
+static OBJLIST<CListEvent> g_cliEvents(10, CompareEvents);
static const char* GetEventProtocol(const CListEvent &ev)
{
@@ -74,6 +74,14 @@ static const char* GetEventProtocol(const CListEvent &ev)
return (ev.flags & CLEF_PROTOCOLGLOBAL) ? ev.moduleName : nullptr;
}
+// remove events for a contact
+void Clist_RemoveContactEvent(MCONTACT hContact)
+{
+ for (auto &it : g_cliEvents.rev_iter())
+ if (it->hContact == hContact)
+ Clist_RemoveEvent(hContact, it->hDbEvent);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
static int fnGetImlIconIndex(HICON hIcon)
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp
index b19de6d6a9..2ddaa28cdf 100644
--- a/src/mir_app/src/clistsettings.cpp
+++ b/src/mir_app/src/clistsettings.cpp
@@ -158,11 +158,7 @@ int ContactDeleted(WPARAM hContact, LPARAM)
clistCache.remove(idx);
}
- // remove events for a contact
- for (auto &it : g_cliEvents.rev_iter())
- if (it->hContact == hContact)
- Clist_RemoveEvent(hContact, it->hDbEvent);
-
+ Clist_RemoveContactEvent(hContact);
Chat_RemoveContact(hContact);
return 0;
}
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h
index 5012fdcc65..b5c52dbdac 100644
--- a/src/mir_app/src/miranda.h
+++ b/src/mir_app/src/miranda.h
@@ -107,14 +107,16 @@ int ImageList_ReplaceIcon_IconLibLoaded(HIMAGELIST hIml, int nIndex, HICON hIcon
#define Safe_DestroyIcon(hIcon) if (hIcon) DestroyIcon(hIcon)
+/**** clistevents.cpp *******************************************************************/
+
+void Clist_RemoveContactEvent(MCONTACT hContact);
+
/**** clistmenus.cpp ********************************************************************/
extern int hMainMenuObject, hContactMenuObject, hStatusMenuObject;
extern HANDLE hPreBuildMainMenuEvent, hPreBuildContactMenuEvent;
extern HMENU hMainMenu, hStatusMenu;
-extern OBJLIST<CListEvent> g_cliEvents;
-
struct MStatus
{
int iStatus;