diff options
Diffstat (limited to 'plugins/NewStory/src/utils.cpp')
-rw-r--r-- | plugins/NewStory/src/utils.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/NewStory/src/utils.cpp b/plugins/NewStory/src/utils.cpp index 5f990fa337..f6aca92604 100644 --- a/plugins/NewStory/src/utils.cpp +++ b/plugins/NewStory/src/utils.cpp @@ -49,6 +49,24 @@ Bitmap* LoadImageFromResource(HINSTANCE hInst, int resourceId, const wchar_t *pw /////////////////////////////////////////////////////////////////////////////////////////
+int SmartSendEvent(int iEventType, MCONTACT hContact, LPARAM hEvent)
+{
+ if (HWND hwnd = WindowList_Find(g_hNewstoryLogs, hContact))
+ SendMessage(hwnd, iEventType, hContact, hEvent);
+
+ if (db_mc_isMeta(hContact)) {
+ // Send a message to a real contact too
+ MCONTACT cc = db_event_getContact(hEvent);
+ if (cc != hContact)
+ if (HWND hwnd = WindowList_Find(g_hNewstoryLogs, cc))
+ SendMessage(hwnd, iEventType, cc, hEvent);
+ }
+
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
uint32_t toggleBit(uint32_t dw, uint32_t bit)
{
if (dw & bit)
|