diff options
author | George Hazan <george.hazan@gmail.com> | 2025-01-03 13:30:24 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2025-01-03 13:30:24 +0300 |
commit | 3f84f1e91015247074f5154498aec78e70b8f471 (patch) | |
tree | 939203e122aed6fb3b15d1b60f5fdc2affc2a60a /plugins/NewStory/src/utils.cpp | |
parent | 24cdeb59d77ffc23f22dd7c7a8d10dcd534a9267 (diff) |
fixes #4822 (NS+TabSRMM - глючит редактирование сообщений)
Diffstat (limited to 'plugins/NewStory/src/utils.cpp')
-rw-r--r-- | plugins/NewStory/src/utils.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/plugins/NewStory/src/utils.cpp b/plugins/NewStory/src/utils.cpp index cfe158f433..927b2b0ab2 100644 --- a/plugins/NewStory/src/utils.cpp +++ b/plugins/NewStory/src/utils.cpp @@ -49,19 +49,29 @@ Bitmap* LoadImageFromResource(HINSTANCE hInst, int resourceId, const wchar_t *pw /////////////////////////////////////////////////////////////////////////////////////////
-int SmartSendEvent(int iEventType, MCONTACT hContact, LPARAM hEvent)
+static void SmartSendEventWorker(MWindowList wndList, int iEventType, MCONTACT cc1, MCONTACT cc2, MEVENT hEvent)
{
- if (HWND hwnd = WindowList_Find(g_hNewstoryLogs, hContact))
- SendMessage(hwnd, iEventType, hContact, hEvent);
+ if (HWND hwnd = WindowList_Find(wndList, cc1))
+ PostMessage(hwnd, iEventType, cc1, hEvent);
- if (db_mc_isMeta(hContact)) {
- // Send a message to a real contact too
+ if (cc2 != INVALID_CONTACT_ID)
+ if (HWND hwnd = WindowList_Find(wndList, cc2))
+ PostMessage(hwnd, iEventType, cc2, hEvent);
+}
+
+int SmartSendEvent(int iEventType, MCONTACT cc1, MEVENT hEvent)
+{
+ MCONTACT cc2 = INVALID_CONTACT_ID;
+
+ // Send a message to a real contact too
+ if (db_mc_isMeta(cc1)) {
MCONTACT cc = db_event_getContact(hEvent);
- if (cc != hContact)
- if (HWND hwnd = WindowList_Find(g_hNewstoryLogs, cc))
- SendMessage(hwnd, iEventType, cc, hEvent);
+ if (cc != cc1)
+ cc2 = cc;
}
+ SmartSendEventWorker(g_hNewstoryLogs, iEventType, cc1, cc2, hEvent);
+ SmartSendEventWorker(g_hNewstoryHistLogs, iEventType, cc1, cc2, hEvent);
return 0;
}
|