summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-11 07:08:40 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-11 07:08:40 +0000
commitbd820972afe24409e6b570adbc45f5dc0fa2385d (patch)
treee600bf39409083219c7928e10ec2b61002529641 /protocols/JabberG/src/jabber_proto.cpp
parent6029165c364f93a84ab7e98ef71d3a711b0f588c (diff)
SRMM icons to be unloaded automatically
git-svn-id: http://svn.miranda-ng.org/main/trunk@4418 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_proto.cpp')
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp41
1 files changed, 16 insertions, 25 deletions
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;
}