summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-02-05 13:17:46 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-02-05 13:17:46 +0300
commit92937e4817268a029cc2446b74319a0d29025ed2 (patch)
tree04c8243f74ab9df13f98fcd217f8609bebe752a0 /protocols/ICQ-WIM/src/proto.cpp
parent89a1de0eaf8377c97c9486492f08ca095effd906 (diff)
fixes #4141 (ICQ: при удалении своего сообщения нужно сразу же запрашивать новые события у сервера)
Diffstat (limited to 'protocols/ICQ-WIM/src/proto.cpp')
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index 9978c83ed6..c9ddc82054 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -209,10 +209,19 @@ void CIcqProto::OnEventEdited(MCONTACT, MEVENT, const DBEVENTINFO &)
/////////////////////////////////////////////////////////////////////////////////////////
// batch events deletion from the server
-void CIcqProto::BatchDeleteMsg()
+void CIcqProto::OnBatchDeleteMsg(MHttpResponse *pReply, AsyncHttpRequest *pReq)
{
- auto *pReq = new AsyncRapiRequest(this, "delMsgBatch");
+ RobustReply root(pReply);
+ if (root.error() != 20000)
+ return;
+
+ if (auto *pUser = FindUser(GetUserId(pReq->hContact)))
+ pUser->m_bSkipPatch = true;
+ RetrievePatches(pReq->hContact);
+}
+void CIcqProto::BatchDeleteMsg()
+{
JSONNode ids(JSON_ARRAY); ids.set_name("msgIds");
mir_cslock lck(m_csDeleteQueue);
@@ -221,6 +230,8 @@ void CIcqProto::BatchDeleteMsg()
mir_free(it);
}
+ auto *pReq = new AsyncRapiRequest(this, "delMsgBatch", &CIcqProto::OnBatchDeleteMsg);
+ pReq->hContact = m_hDeleteContact;
pReq->params << WCHAR_PARAM("sn", GetUserId(m_hDeleteContact)) << BOOL_PARAM("silent", true) << BOOL_PARAM("shared", m_bRemoveForAll) << ids;
Push(pReq);
@@ -230,7 +241,8 @@ void CIcqProto::BatchDeleteMsg()
void CIcqProto::OnEventDeleted(MCONTACT hContact, MEVENT hEvent, int flags)
{
- if (!(flags & CDF_FROM_SERVER))
+ // the command arrived from the server, don't send it back then
+ if (flags & CDF_FROM_SERVER)
return;
if (m_hDeleteContact != INVALID_CONTACT_ID)