summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2018-10-16 11:11:20 +0500
committerElzorFox <elzorfox@ya.ru>2018-10-16 11:11:20 +0500
commite4df28b4a013cc44febf9ee9075c7601d8ed857d (patch)
tree5c788c3f18926760e49dce58ba5d84e31d1240e1 /src/mir_app
parent6d45513e046c47799219630158c8e3b50f40f3f1 (diff)
dbx_mdbx: fix return value for db_event_edit
mir_app: fix adding messages with IDs that were deleted earlier
Diffstat (limited to 'src/mir_app')
-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;
}