summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-15 18:35:21 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-15 18:35:28 +0300
commit436e303e24e5046d6cc52ac3da51a0b51adbef36 (patch)
tree4f7d3b27ad24e710dae845558e2d719b54d1d88a /src
parentf0d86d413859d402331b49b98db7d61fef801489 (diff)
simpler way of applying server ids to messages
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/cmdlist.cpp5
-rw-r--r--src/mir_app/src/MDatabaseReadonly.cpp5
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/proto_interface.cpp4
-rw-r--r--src/mir_core/src/db.cpp5
-rw-r--r--src/mir_core/src/mir_core.def1
-rw-r--r--src/mir_core/src/mir_core64.def1
8 files changed, 3 insertions, 20 deletions
diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp
index 35fbcac30a..dc399a27e2 100644
--- a/src/core/stdmsg/src/cmdlist.cpp
+++ b/src/core/stdmsg/src/cmdlist.cpp
@@ -95,15 +95,14 @@ void msgQueue_processack(MCONTACT hContact, int id, BOOL success, LPARAM lParam)
dbei.timestamp = time(0);
dbei.cbBlob = (DWORD)(mir_strlen(p->szMsg) + 1);
dbei.pBlob = (PBYTE)p->szMsg;
+ dbei.szId = (char *)lParam;
MessageWindowEvent evt = { id, hContact, &dbei };
NotifyEventHooks(g_chatApi.hevPreCreate, 0, (LPARAM)&evt);
p->szMsg = (char*)dbei.pBlob;
- MEVENT hNewEvent = db_event_add(hContact, &dbei);
- if (hNewEvent && lParam)
- db_event_setId(dbei.szModule, hNewEvent, (char*)lParam);
+ db_event_add(hContact, &dbei);
mir_free(p->szMsg);
mir_free(p);
diff --git a/src/mir_app/src/MDatabaseReadonly.cpp b/src/mir_app/src/MDatabaseReadonly.cpp
index c5ab94fed6..1de92de019 100644
--- a/src/mir_app/src/MDatabaseReadonly.cpp
+++ b/src/mir_app/src/MDatabaseReadonly.cpp
@@ -146,8 +146,3 @@ MEVENT MDatabaseReadonly::GetEventById(LPCSTR, LPCSTR)
{
return 0;
}
-
-BOOL MDatabaseReadonly::SetEventId(LPCSTR, MEVENT, LPCSTR)
-{
- return FALSE;
-}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index c096e56e47..73c6f0edf6 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -597,7 +597,6 @@ Miranda_WaitOnHandleEx @663
??0MDatabaseReadonly@@QAE@XZ @684 NONAME
??_7MDatabaseReadonly@@6B@ @685 NONAME
?GetEventById@MDatabaseReadonly@@UAGIPBD0@Z @686 NONAME
-?SetEventId@MDatabaseReadonly@@UAGHPBDI0@Z @687 NONAME
?EditEvent@MDatabaseReadonly@@UAGHIIPBUDBEVENTINFO@@@Z @688 NONAME
g_hevContactAdded @689 NONAME
g_hevContactDeleted @690 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 3cba4b2b3b..9dcb0e0cab 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -597,7 +597,6 @@ Miranda_WaitOnHandleEx @663
??0MDatabaseReadonly@@QEAA@XZ @684 NONAME
??_7MDatabaseReadonly@@6B@ @685 NONAME
?GetEventById@MDatabaseReadonly@@UEAAIPEBD0@Z @686 NONAME
-?SetEventId@MDatabaseReadonly@@UEAAHPEBDI0@Z @687 NONAME
?EditEvent@MDatabaseReadonly@@UEAAHIIPEBUDBEVENTINFO@@@Z @688 NONAME
g_hevContactAdded @689 NONAME
g_hevContactDeleted @690 NONAME
diff --git a/src/mir_app/src/proto_interface.cpp b/src/mir_app/src/proto_interface.cpp
index 8eb3f862fc..c4b978a13f 100644
--- a/src/mir_app/src/proto_interface.cpp
+++ b/src/mir_app/src/proto_interface.cpp
@@ -199,11 +199,9 @@ MEVENT PROTO_INTERFACE::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre)
if ((GetCaps(PFLAGNUM_4) & PF4_SERVERMSGID) && pre->szMsgId != nullptr) {
MEVENT hDbEvent = db_event_getById(m_szModuleName, pre->szMsgId);
if (hDbEvent == 0 || db_event_edit(hContact, hDbEvent, &dbei)) {
+ dbei.szId = pre->szMsgId;
hDbEvent = db_event_add(hContact, &dbei);
- if (hDbEvent)
- db_event_setId(m_szModuleName, hDbEvent, pre->szMsgId);
}
-
return hDbEvent;
}
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp
index 62fd662b35..322402e22e 100644
--- a/src/mir_core/src/db.cpp
+++ b/src/mir_core/src/db.cpp
@@ -431,11 +431,6 @@ MIR_CORE_DLL(MEVENT) db_event_getById(const char *szModule, const char *szId)
return (currDb == nullptr) ? 0 : currDb->GetEventById(szModule, szId);
}
-MIR_CORE_DLL(MEVENT) db_event_setId(const char *szModule, MEVENT hDbEvent, const char *szId)
-{
- return (currDb == nullptr) ? 0 : currDb->SetEventId(szModule, hDbEvent, szId);
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// event cursors
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 6ccd0c16b5..829aeb94c4 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1042,7 +1042,6 @@ CallObjectEventHook @1259
?CheckRowCount@CCtrlPages@@AAEXXZ @1264 NONAME
?VerifyControls@CDlgBase@@AAE_NP8CCtrlBase@@AE_NXZ@Z @1265 NONAME
db_event_getById @1266
-db_event_setId @1267
db_event_edit @1268
??0StrPair@tinyxml2@@QAE@XZ @1269 NONAME
??0XMLAttribute@tinyxml2@@AAE@XZ @1270 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 9779067440..41bebe9ac7 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1042,7 +1042,6 @@ CallObjectEventHook @1259
?CheckRowCount@CCtrlPages@@AEAAXXZ @1264 NONAME
?VerifyControls@CDlgBase@@AEAA_NP8CCtrlBase@@EAA_NXZ@Z @1265 NONAME
db_event_getById @1266
-db_event_setId @1267
db_event_edit @1268
??0StrPair@tinyxml2@@QEAA@XZ @1269 NONAME
??0XMLAttribute@tinyxml2@@AEAA@XZ @1270 NONAME