summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-10 23:31:02 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-10 23:31:02 +0300
commit56171c4f775f0c1cfa215b2273f5b3b9a93d145d (patch)
tree196b0ce10e8c9d2dff1f664321453bfb691ce097 /protocols
parent7346b03e8c19eb1c99aa7cb64948c662194ff83d (diff)
grabbed two kosher email icons from old MRA plugin
Diffstat (limited to 'protocols')
-rw-r--r--protocols/ICQ-WIM/res/Mail.icobin0 -> 1150 bytes
-rw-r--r--protocols/ICQ-WIM/res/MailNotify.icobin0 -> 1150 bytes
-rw-r--r--protocols/ICQ-WIM/res/resources.rc10
-rw-r--r--protocols/ICQ-WIM/src/main.cpp8
-rw-r--r--protocols/ICQ-WIM/src/poll.cpp9
-rw-r--r--protocols/ICQ-WIM/src/resource.h2
-rw-r--r--protocols/ICQ-WIM/src/stdafx.h1
7 files changed, 26 insertions, 4 deletions
diff --git a/protocols/ICQ-WIM/res/Mail.ico b/protocols/ICQ-WIM/res/Mail.ico
new file mode 100644
index 0000000000..25bedbfbb2
--- /dev/null
+++ b/protocols/ICQ-WIM/res/Mail.ico
Binary files differ
diff --git a/protocols/ICQ-WIM/res/MailNotify.ico b/protocols/ICQ-WIM/res/MailNotify.ico
new file mode 100644
index 0000000000..9e87d4bfcb
--- /dev/null
+++ b/protocols/ICQ-WIM/res/MailNotify.ico
Binary files differ
diff --git a/protocols/ICQ-WIM/res/resources.rc b/protocols/ICQ-WIM/res/resources.rc
index 084705d83d..9fd841398e 100644
--- a/protocols/ICQ-WIM/res/resources.rc
+++ b/protocols/ICQ-WIM/res/resources.rc
@@ -20,6 +20,16 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
/////////////////////////////////////////////////////////////////////////////
//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_INBOX ICON "Mail.ico"
+IDI_MAIL_NOTIFY ICON "MailNotify.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
// Dialog
//
diff --git a/protocols/ICQ-WIM/src/main.cpp b/protocols/ICQ-WIM/src/main.cpp
index a27e2f3fa8..cd55059b6c 100644
--- a/protocols/ICQ-WIM/src/main.cpp
+++ b/protocols/ICQ-WIM/src/main.cpp
@@ -24,6 +24,12 @@ bool g_bPopupService, g_bMessageState;
HWND g_hwndHeartbeat;
+IconItem iconList[] =
+{
+ { LPGEN("Email"), "icq_email", IDI_INBOX },
+ { LPGEN("Email notification"), "icq_email_notif", IDI_MAIL_NOTIFY }
+};
+
/////////////////////////////////////////////////////////////////////////////////////////
static PLUGININFOEX pluginInfoEx = {
@@ -124,6 +130,8 @@ int CMPlugin::Load()
{
g_hwndHeartbeat = CreateWindowEx(0, L"STATIC", nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr);
+ registerIcon("Protocols/ICQ", iconList, "ICQ");
+
HookEvent(ME_SYSTEM_MODULELOAD, ModuleLoad);
HookEvent(ME_SYSTEM_MODULEUNLOAD, ModuleLoad);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/protocols/ICQ-WIM/src/poll.cpp b/protocols/ICQ-WIM/src/poll.cpp
index d417b09d9c..563ba2b9aa 100644
--- a/protocols/ICQ-WIM/src/poll.cpp
+++ b/protocols/ICQ-WIM/src/poll.cpp
@@ -205,13 +205,14 @@ void CIcqProto::ProcessNotification(const JSONNode &ev)
for (auto &fld : ev["fields"]) {
const JSONNode &email = fld["mailbox.newMessage"];
if (email) {
- CMStringW wszFrom(email["from"].as_mstring());
- CMStringW wszSubj(email["subject"].as_mstring());
- m_unreadEmails = email["unreadCount"].as_int();
+ JSONROOT root(email.as_string().c_str());
+ CMStringW wszFrom((*root)["from"].as_mstring());
+ CMStringW wszSubj((*root)["subject"].as_mstring());
+ m_unreadEmails = (*root)["unreadCount"].as_int();
POPUPDATAT Popup = {};
mir_snwprintf(Popup.lptzText, LPGENW("You received e-mail from %s: %s"), wszFrom.c_str(), wszSubj.c_str());
- Popup.lchIcon = IcoLib_GetIconByHandle(Skin_GetIconHandle(SKINICON_EVENT_MESSAGE), true);
+ Popup.lchIcon = IcoLib_GetIconByHandle(iconList[1].hIcolib);
if (g_bPopupService) {
wcsncpy_s(Popup.lptzContactName, m_tszUserName, _TRUNCATE);
CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&Popup, 0);
diff --git a/protocols/ICQ-WIM/src/resource.h b/protocols/ICQ-WIM/src/resource.h
index 9d8b7a0d2f..ce308ae793 100644
--- a/protocols/ICQ-WIM/src/resource.h
+++ b/protocols/ICQ-WIM/src/resource.h
@@ -8,6 +8,8 @@
#define IDD_INFO_ICQ 104
#define IDD_REGISTER 105
#define IDD_EDITIGNORE 106
+#define IDI_INBOX 107
+#define IDI_MAIL_NOTIFY 108
#define IDC_PASSWORD 1001
#define IDC_UIN 1002
#define IDC_UIN2 1003
diff --git a/protocols/ICQ-WIM/src/stdafx.h b/protocols/ICQ-WIM/src/stdafx.h
index 8725dfd75b..7f1ea98575 100644
--- a/protocols/ICQ-WIM/src/stdafx.h
+++ b/protocols/ICQ-WIM/src/stdafx.h
@@ -104,3 +104,4 @@ char* time2text(time_t time);
extern HWND g_hwndHeartbeat;
extern bool g_bPopupService, g_bMessageState;
+extern IconItem iconList[];