From 899221e2d058f5afe30bb2ecdbf168c8ad3c15a6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 27 Jan 2023 19:48:42 +0300 Subject: Group chats: all old APIs with lookup by module+session removed --- protocols/WhatsApp/src/appsync.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'protocols/WhatsApp/src/appsync.cpp') diff --git a/protocols/WhatsApp/src/appsync.cpp b/protocols/WhatsApp/src/appsync.cpp index 9607045131..3d812be370 100644 --- a/protocols/WhatsApp/src/appsync.cpp +++ b/protocols/WhatsApp/src/appsync.cpp @@ -115,7 +115,7 @@ void WhatsAppProto::OnIqServerSync(const WANode &node) if (dwVersion > pCollection->version) { pCollection->hash.init(); debugLogA("%s: applying snapshot of version %d", pCollection->szName.get(), dwVersion); - for (int i=0; i < snapshot->n_records; i++) + for (unsigned i = 0; i < snapshot->n_records; i++) ParsePatch(pCollection, snapshot->records[i], true); } else debugLogA("%s: skipping snapshot of version %d", pCollection->szName.get(), dwVersion); @@ -132,7 +132,7 @@ void WhatsAppProto::OnIqServerSync(const WANode &node) dwVersion = patch->version->version; if (dwVersion > pCollection->version) { debugLogA("%s: applying patch of version %d", pCollection->szName.get(), dwVersion); - for (int i = 0; i < patch->n_mutations; i++) { + for (unsigned i = 0; i < patch->n_mutations; i++) { auto &jt = *patch->mutations[i]; ParsePatch(pCollection, jt.record, jt.operation == WA__SYNCD_MUTATION__SYNCD_OPERATION__SET); } @@ -255,11 +255,11 @@ void WhatsAppProto::ProcessHistorySync(const Wa__HistorySync *pSync) switch (pSync->synctype) { case WA__HISTORY_SYNC__HISTORY_SYNC_TYPE__INITIAL_BOOTSTRAP: case WA__HISTORY_SYNC__HISTORY_SYNC_TYPE__RECENT: - for (int i = 0; i < pSync->n_conversations; i++) { + for (unsigned i = 0; i < pSync->n_conversations; i++) { auto *pChat = pSync->conversations[i]; auto *pUser = AddUser(pChat->id, false); - for (int j = 0; j < pChat->n_messages; j++) { + for (unsigned j = 0; j < pChat->n_messages; j++) { auto *pMessage = pChat->messages[j]; if (!pMessage->message) continue; @@ -287,9 +287,8 @@ void WhatsAppProto::ProcessHistorySync(const Wa__HistorySync *pSync) if (pChat->name) setUString(pUser->hContact, "Nick", pChat->name); - GCEVENT gce = {m_szModuleName, 0, GC_EVENT_MESSAGE}; + GCEVENT gce = { pUser->si, GC_EVENT_MESSAGE }; gce.dwFlags = GCEF_UTF8; - gce.pszID.a = pUser->szId; gce.pszUID.a = key->participant; gce.bIsMe = key->fromme; gce.pszText.a = szMessageText.GetBuffer(); @@ -305,7 +304,7 @@ void WhatsAppProto::ProcessHistorySync(const Wa__HistorySync *pSync) break; case WA__HISTORY_SYNC__HISTORY_SYNC_TYPE__PUSH_NAME: - for (int i = 0; i < pSync->n_pushnames; i++) { + for (unsigned i = 0; i < pSync->n_pushnames; i++) { auto *pName = pSync->pushnames[i]; if (auto *pUser = AddUser(pName->id, false)) setUString(pUser->hContact, "Nick", pName->pushname); @@ -313,7 +312,7 @@ void WhatsAppProto::ProcessHistorySync(const Wa__HistorySync *pSync) break; case WA__HISTORY_SYNC__HISTORY_SYNC_TYPE__INITIAL_STATUS_V3: - for (int i = 0; i < pSync->n_statusv3messages; i++) { + for (unsigned i = 0; i < pSync->n_statusv3messages; i++) { // TODO // auto *pStatus = pSync->statusv3messages[i]; } -- cgit v1.2.3