diff options
author | George Hazan <ghazan@miranda.im> | 2019-01-07 23:02:47 +0200 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-01-07 23:02:47 +0200 |
commit | bf04597aff198a45ac7e5ae35d5efa35a9b46be5 (patch) | |
tree | 5ad8a7cb096d6854cc41e6a98c2961ebee427a2e /protocols | |
parent | fb45cf394b9dc68b5df0bb1bcaab0cf5a7947a03 (diff) |
one more way to support message delivery
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Icq10/src/http.cpp | 2 | ||||
-rw-r--r-- | protocols/Icq10/src/http.h | 2 | ||||
-rw-r--r-- | protocols/Icq10/src/server.cpp | 6 |
3 files changed, 9 insertions, 1 deletions
diff --git a/protocols/Icq10/src/http.cpp b/protocols/Icq10/src/http.cpp index 5645399e7e..68424165b2 100644 --- a/protocols/Icq10/src/http.cpp +++ b/protocols/Icq10/src/http.cpp @@ -52,6 +52,7 @@ void __cdecl CIcqProto::ServerThread(void*) int ts = time(0); for (auto &it : m_ConnPool) { if (it.s && it.lastTs + it.timeout < ts) { + debugLogA("Socket #1 (%p) expired", int(&it - m_ConnPool), it.s); Netlib_CloseHandle(it.s); it.s = nullptr; it.lastTs = 0; @@ -218,6 +219,7 @@ JsonReply::JsonReply(NETLIBHTTPREQUEST *pReply) JSONNode &response = (*m_root)["response"]; m_errorCode = response["statusCode"].as_int(); + m_requestId = response["requestId"].as_mstring(); m_detailCode = response["statusDetailCode"].as_int(); m_data = &response["data"]; } diff --git a/protocols/Icq10/src/http.h b/protocols/Icq10/src/http.h index 1270d9445e..05dfa9ef99 100644 --- a/protocols/Icq10/src/http.h +++ b/protocols/Icq10/src/http.h @@ -21,11 +21,13 @@ class JsonReply JSONNode *m_root = nullptr; int m_errorCode = 0, m_detailCode = 0; JSONNode* m_data = nullptr; + CMStringA m_requestId; public: JsonReply(NETLIBHTTPREQUEST*); ~JsonReply(); + __forceinline const CMStringA& requestId() const { return m_requestId; } __forceinline JSONNode& data() const { return *m_data; } __forceinline int error() const { return m_errorCode; } __forceinline int detail() const { return m_detailCode; } diff --git a/protocols/Icq10/src/server.cpp b/protocols/Icq10/src/server.cpp index d46e41ec70..ddc22df1f8 100644 --- a/protocols/Icq10/src/server.cpp +++ b/protocols/Icq10/src/server.cpp @@ -588,7 +588,11 @@ void CIcqProto::OnSendMessage(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq) } } - CheckLastId(ownMsg->m_hContact, root.data()); + const JSONNode &data = root.data(); + CMStringA reqId(root.requestId()); + CMStringA msgId(data["histMsgId"].as_mstring()); + CheckOwnMessage(reqId, msgId, false); + CheckLastId(ownMsg->m_hContact, data); } ///////////////////////////////////////////////////////////////////////////////////////// |