diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-26 21:42:30 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-26 21:42:30 +0300 |
commit | be77f747e64b695328b1dc529d93846165f8f487 (patch) | |
tree | 0a9367b1e064be22f67392db345658e61c3e5f65 /protocols/Icq10/src/server.cpp | |
parent | c6e113731519bb85e0a79196ad32986e8b077e07 (diff) |
icq10: fix for message sending timeout
Diffstat (limited to 'protocols/Icq10/src/server.cpp')
-rw-r--r-- | protocols/Icq10/src/server.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/protocols/Icq10/src/server.cpp b/protocols/Icq10/src/server.cpp index 6ad4897cd8..7b154ba4c7 100644 --- a/protocols/Icq10/src/server.cpp +++ b/protocols/Icq10/src/server.cpp @@ -208,14 +208,13 @@ void CIcqProto::OnSendMessage(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq) JsonReply root(pReply); if (root.error() != 200) { ProtoBroadcastAck(ownMsg->m_hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)ownMsg->m_msgid, 0); - delete ownMsg; - return; + for (auto &it : m_arOwnIds) { + if (it == ownMsg) { + m_arOwnIds.remove(m_arOwnIds.indexOf(&it)); + break; + } + } } - - JSONNode &data = root.data(); - CMStringA msgId(data["msgId"].as_mstring()); - strncpy_s(ownMsg->m_guid, msgId, _TRUNCATE); - m_arOwnIds.insert(ownMsg); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -322,6 +321,7 @@ void CIcqProto::ProcessHistData(const JSONNode &ev) if (!mir_strcmp(reqId, ownMsg->m_guid)) { bSkipped = true; ProtoBroadcastAck(ownMsg->m_hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)ownMsg->m_msgid, (LPARAM)msgId.c_str()); + m_arOwnIds.remove(m_arOwnIds.indexOf(&ownMsg)); break; } |