From bd820972afe24409e6b570adbc45f5dc0fa2385d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 11 Apr 2013 07:08:40 +0000 Subject: SRMM icons to be unloaded automatically git-svn-id: http://svn.miranda-ng.org/main/trunk@4418 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_proto.cpp | 41 +++++++++++++--------------------- 1 file changed, 16 insertions(+), 25 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 8f68e215aa..967176d71a 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -294,31 +294,24 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) JHookEvent(ME_GC_BUILDMENU, &CJabberProto::JabberGcMenuHook); } - if (ServiceExists(MS_MSG_ADDICON)) { - StatusIconData sid = { sizeof(sid) }; - sid.szModule = m_szModuleName; - sid.hIcon = sid.hIconDisabled = LoadIconEx("main"); - sid.flags = MBF_HIDDEN; - sid.szTooltip = Translate("Jabber Resource"); - CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid); - Skin_ReleaseIcon(sid.hIcon); - - JHookEvent(ME_MSG_ICONPRESSED, &CJabberProto::OnProcessSrmmIconClick); - JHookEvent(ME_MSG_WINDOWEVENT, &CJabberProto::OnProcessSrmmEvent); - - for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) - MenuHideSrmmIcon(hContact); - } - - DBEVENTTYPEDESCR dbEventType = {0}; - dbEventType.cbSize = sizeof(DBEVENTTYPEDESCR); - dbEventType.eventType = JABBER_DB_EVENT_TYPE_CHATSTATES; + StatusIconData sid = { sizeof(sid) }; + sid.szModule = m_szModuleName; + sid.hIcon = sid.hIconDisabled = LoadIconEx("main"); + sid.flags = MBF_HIDDEN; + sid.szTooltip = Translate("Jabber Resource"); + Srmm_AddIcon(&sid); + Skin_ReleaseIcon(sid.hIcon); + + JHookEvent(ME_MSG_ICONPRESSED, &CJabberProto::OnProcessSrmmIconClick); + JHookEvent(ME_MSG_WINDOWEVENT, &CJabberProto::OnProcessSrmmEvent); + + DBEVENTTYPEDESCR dbEventType = { sizeof(dbEventType) }; dbEventType.module = m_szModuleName; + dbEventType.eventType = JABBER_DB_EVENT_TYPE_CHATSTATES; dbEventType.descr = "Chat state notifications"; CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType); dbEventType.eventType = JABBER_DB_EVENT_TYPE_PRESENCE; - dbEventType.module = m_szModuleName; dbEventType.descr = "Presence notifications"; CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType); @@ -378,11 +371,9 @@ int __cdecl CJabberProto::OnPreShutdown(WPARAM, LPARAM) m_sendManager.Shutdown(); ConsoleUninit(); - if (ServiceExists(MS_MSG_REMOVEICON)) { - StatusIconData sid = { sizeof(sid) }; - sid.szModule = m_szModuleName; - CallService(MS_MSG_REMOVEICON, 0, (LPARAM)&sid); - } + StatusIconData sid = { sizeof(sid) }; + sid.szModule = m_szModuleName; + Srmm_RemoveIcon(&sid); return 0; } -- cgit v1.2.3