summaryrefslogtreecommitdiff
path: root/plugins/Scriver
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-03-15 18:08:51 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-03-15 18:08:51 +0300
commitcf91db5000d4f11745e2fe8bb6e7f5c6c6ba162a (patch)
tree00340b66a65ff421381496798f033a3150754570 /plugins/Scriver
parent3a02afffa431d57c9f31a542fa95710dcf3fc3d5 (diff)
SRMM: common code exctracted to a Srmm_AddEvent() function
Diffstat (limited to 'plugins/Scriver')
-rw-r--r--plugins/Scriver/src/msgs.cpp32
1 files changed, 5 insertions, 27 deletions
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index e939a1c69e..8302c903ce 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -108,19 +108,9 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
}
}
- if (hwnd == nullptr || !IsWindowVisible(GetParent(hwnd))) {
- wchar_t toolTip[256];
- mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(hContact));
-
- CLISTEVENT cle = {};
- cle.flags = CLEF_UNICODE;
- cle.hContact = hContact;
- cle.hDbEvent = hDbEvent;
- cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- cle.pszService = MS_MSG_READMESSAGE;
- cle.szTooltip.w = toolTip;
- g_clistApi.pfnAddEvent(&cle);
- }
+ if (hwnd == nullptr || !IsWindowVisible(GetParent(hwnd)))
+ Srmm_AddEvent(hContact, hDbEvent);
+
return 0;
}
@@ -263,20 +253,8 @@ static void RestoreUnreadMessageAlerts(void)
}
}
- wchar_t toolTip[256];
-
- CLISTEVENT cle = {};
- cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- cle.pszService = MS_MSG_READMESSAGE;
- cle.flags = CLEF_UNICODE;
- cle.szTooltip.w = toolTip;
-
- for (auto &e : arEvents) {
- mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(e->hContact));
- cle.hContact = e->hContact;
- cle.hDbEvent = e->hEvent;
- g_clistApi.pfnAddEvent(&cle);
- }
+ for (auto &e : arEvents)
+ Srmm_AddEvent(e->hContact, e->hEvent);
}
void CMsgDialog::SetStatusText(const wchar_t *wszText, HICON hIcon)