summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/proto_utils.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mir_app/src/proto_utils.cpp b/src/mir_app/src/proto_utils.cpp
index a82f92eb78..4f3c2a0206 100644
--- a/src/mir_app/src/proto_utils.cpp
+++ b/src/mir_app/src/proto_utils.cpp
@@ -517,12 +517,11 @@ MEVENT PROTO_INTERFACE::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre)
// if it's possible to find an existing event by its id, do that
if ((GetCaps(PFLAGNUM_4) & PF4_SERVERMSGID) && pre->szMsgId != nullptr) {
MEVENT hDbEvent = db_event_getById(m_szModuleName, pre->szMsgId);
- if (hDbEvent == 0) {
+ if (hDbEvent == 0 || db_event_edit(hContact, hDbEvent, &dbei)) {
hDbEvent = db_event_add(hContact, &dbei);
if (hDbEvent)
db_event_setId(m_szModuleName, hDbEvent, pre->szMsgId);
}
- else db_event_edit(hContact, hDbEvent, &dbei);
return hDbEvent;
}