From e808179197e8875f3faa85ad8f0d1e75d756716f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 1 Oct 2018 15:36:26 +0300 Subject: centralized system of processing message ids. also fixes #1375 --- protocols/JabberG/src/jabber_omemo.cpp | 4 +--- protocols/JabberG/src/jabber_proto.cpp | 11 ----------- protocols/JabberG/src/jabber_proto.h | 2 -- protocols/JabberG/src/jabber_thread.cpp | 3 +-- 4 files changed, 2 insertions(+), 18 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp index f52b0340fc..186cd5c2e9 100755 --- a/protocols/JabberG/src/jabber_omemo.cpp +++ b/protocols/JabberG/src/jabber_omemo.cpp @@ -1875,11 +1875,9 @@ bool CJabberProto::OmemoHandleMessage(HXML node, wchar_t *jid, time_t msgTime) if (m_bFixIncorrectTimestamps && (msgTime > now || (msgTime < (time_t)JabberGetLastContactMessageTime(hContact)))) msgTime = now; - pResourceStatus pFromResource(ResourceInfoFromJID(jid)); - PROTORECVEVENT recv = { 0 }; + PROTORECVEVENT recv = {}; recv.timestamp = (DWORD)msgTime; recv.szMessage = mir_strdup(out); - recv.lParam = (LPARAM)((pFromResource != nullptr && m_bEnableRemoteControl) ? pFromResource->m_tszResourceName : 0); ProtoChainRecvMsg(hContact, &recv); mir_free(out); return true; diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 48575d97d9..7a29dc6e91 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -804,17 +804,6 @@ HANDLE CJabberProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, return (HANDLE)pInfo->GetIqId(); } -//////////////////////////////////////////////////////////////////////////////////////// -// RecvMsg - -MEVENT CJabberProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *evt) -{ - MEVENT hDbEvent = CSuper::RecvMsg(hContact, evt); - if (hDbEvent != 0 && evt->lParam) - db_event_setId(m_szModuleName, hDbEvent, T2Utf((const wchar_t *)evt->lParam)); - return hDbEvent; -} - //////////////////////////////////////////////////////////////////////////////////////// // SendContacts diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 6bd4a2d6da..38ba232fbc 100755 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -96,8 +96,6 @@ struct CJabberProto : public PROTO, public IJabberInterface HWND SearchAdvanced(HWND owner) override; HWND CreateExtendedSearchUI(HWND owner) override; - MEVENT RecvMsg(MCONTACT hContact, PROTORECVEVENT*) override; - int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) override; HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override; int SendMsg(MCONTACT hContact, int flags, const char *msg) override; diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 6ad324838b..3246229ff4 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1496,7 +1496,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) if (m_bFixIncorrectTimestamps && (msgTime > now || (msgTime < (time_t)JabberGetLastContactMessageTime(hContact)))) msgTime = now; - PROTORECVEVENT recv = { 0 }; + PROTORECVEVENT recv = {}; if (carbon) { recv.flags |= PREF_CREATEREAD; if (carbonSent) @@ -1504,7 +1504,6 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) } recv.timestamp = (DWORD)msgTime; recv.szMessage = buf; - recv.lParam = (LPARAM)((pFromResource != nullptr && m_bEnableRemoteControl) ? pFromResource->m_tszResourceName : 0); ProtoChainRecvMsg(hContact, &recv); } -- cgit v1.2.3