diff options
author | George Hazan <ghazan@miranda.im> | 2019-03-07 22:38:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-03-07 22:40:54 +0300 |
commit | 6712ce9307350ef5c04f184b0cb80cfe75af77c5 (patch) | |
tree | 3baa482fecc7e53c7843e8ae89a6bc6678b0570d /plugins/MessageState/src | |
parent | fab3905d91890102046dcc4554721991ae8ff413 (diff) |
Srmm_ModifyIcon now changes only tooltip and/or icon, Srmm_SetIconFlags controls flags
Diffstat (limited to 'plugins/MessageState/src')
-rw-r--r-- | plugins/MessageState/src/messagestate.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp index 0e52b1d5ad..10735e977c 100644 --- a/plugins/MessageState/src/messagestate.cpp +++ b/plugins/MessageState/src/messagestate.cpp @@ -19,11 +19,6 @@ const wchar_t* Tooltips[] = void SetSRMMIcon(MCONTACT hContact, SRMM_ICON_TYPE type, time_t time)
{
- StatusIconData sid = {};
- sid.szModule = MODULENAME;
- sid.dwId = 1;
- sid.flags = MBF_UNICODE;
-
MCONTACT hActualContact;
if (db_mc_isMeta(hContact))
hActualContact = db_mc_getSrmmSub(hContact);
@@ -31,21 +26,20 @@ void SetSRMMIcon(MCONTACT hContact, SRMM_ICON_TYPE type, time_t time) hActualContact = hContact;
if (type != ICON_HIDDEN) {
- sid.hIcon = IcoLib_GetIconByHandle(Icons[type].hIcolib);
-
+ const wchar_t *pwszToolTip;
if (type == ICON_READ) {
if (g_plugin.getDword(hActualContact, DBKEY_MESSAGE_READ_TIME_TYPE, -1) == MRD_TYPE_READTIME) {
wchar_t buf[100];
wcsftime(buf, _countof(buf), TranslateT("Last message read at %X %x"), localtime(&time));
- sid.szTooltip.w = buf;
+ pwszToolTip = buf;
}
- else sid.szTooltip.w = TranslateT("Last message read (unknown time)");
+ else pwszToolTip = TranslateT("Last message read (unknown time)");
}
- else sid.szTooltip.w = TranslateW(Tooltips[type]);
+ else pwszToolTip = TranslateW(Tooltips[type]);
+
+ Srmm_ModifyIcon(hContact, MODULENAME, 1, IcoLib_GetIconByHandle(Icons[type].hIcolib), pwszToolTip);
}
- else sid.flags |= MBF_HIDDEN;
-
- Srmm_ModifyIcon(hContact, &sid);
+ else Srmm_SetIconFlags(hContact, MODULENAME, 1, MBF_HIDDEN);
}
int IconsUpdate(MCONTACT hContact)
|