diff options
Diffstat (limited to 'protocols/WhatsAppWeb/src')
-rw-r--r-- | protocols/WhatsAppWeb/src/proto.h | 2 | ||||
-rw-r--r-- | protocols/WhatsAppWeb/src/server.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/protocols/WhatsAppWeb/src/proto.h b/protocols/WhatsAppWeb/src/proto.h index 7ab3bd2921..3d66a8f3ff 100644 --- a/protocols/WhatsAppWeb/src/proto.h +++ b/protocols/WhatsAppWeb/src/proto.h @@ -128,7 +128,7 @@ class WhatsAppProto : public PROTO<WhatsAppProto> // binary packets void ProcessBinaryPacket(const MBinBuffer &buf); - void ProcessAdd(const JSONNode &node); + void ProcessAdd(const CMStringA &type, const JSONNode &node); void ProcessChats(const JSONNode &node); void ProcessContacts(const JSONNode &node); diff --git a/protocols/WhatsAppWeb/src/server.cpp b/protocols/WhatsAppWeb/src/server.cpp index 9c7bd92832..db2403034a 100644 --- a/protocols/WhatsAppWeb/src/server.cpp +++ b/protocols/WhatsAppWeb/src/server.cpp @@ -444,15 +444,15 @@ void WhatsAppProto::ProcessBinaryPacket(const MBinBuffer &buf) else if (szType == "chat") ProcessChats(root["$list$"]); else { - CMStringW szAdd = root["add"].as_mstring(); + CMStringA szAdd = root["add"].as_mstring(); if (!szAdd.IsEmpty()) - ProcessAdd(root["$list$"]); + ProcessAdd(szAdd, root["$list$"]); } } ///////////////////////////////////////////////////////////////////////////////////////// -void WhatsAppProto::ProcessAdd(const JSONNode &list) +void WhatsAppProto::ProcessAdd(const CMStringA &type, const JSONNode &list) { for (auto &it : list) { std::string buf = it["$bin$"].as_string(); @@ -508,7 +508,7 @@ void WhatsAppProto::ProcessAdd(const JSONNode &list) PROTORECVEVENT pre = { 0 }; pre.timestamp = dwTimestamp; pre.szMessage = szMsgText.GetBuffer(); - pre.flags = PREF_CREATEREAD; + pre.flags = (type == "relay" ? 0 : PREF_CREATEREAD); pre.szMsgId = key.id().c_str(); if (key.fromme()) pre.flags |= PREF_SENT; |