diff options
author | ElzorFox <elzorfox@ya.ru> | 2018-09-27 12:33:54 +0500 |
---|---|---|
committer | ElzorFox <elzorfox@ya.ru> | 2018-09-27 12:33:54 +0500 |
commit | cb3f9df94ba93527b8c589346b7b4482abad0fae (patch) | |
tree | a2ffa9de1fac79b4abdb23a2ecd1dda6aba83a4f /plugins/Scriver | |
parent | 5a670ae5582c7566c74567429cdbe296190c7284 (diff) |
Scriver: fix loading read messages into the log when contact window is open
Diffstat (limited to 'plugins/Scriver')
-rw-r--r-- | plugins/Scriver/src/msgs.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index ac2bfd44ce..15b664fd95 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -88,10 +88,6 @@ static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam) static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
{
MEVENT hDbEvent = (MEVENT)lParam;
- DBEVENTINFO dbei = {};
- db_event_get(hDbEvent, &dbei);
- if (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ))
- return 0;
HWND hwnd = Srmm_FindWindow(hContact);
if (hwnd == nullptr)
@@ -99,6 +95,12 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) if (hwnd)
SendMessage(hwnd, HM_DBEVENTADDED, hContact, lParam);
+ DBEVENTINFO dbei = {};
+ db_event_get(hDbEvent, &dbei);
+
+ if (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ))
+ return 0;
+
if (dbei.flags & DBEF_SENT || !DbEventIsMessageOrCustom(&dbei))
return 0;
|