dong_dl 1 anno fa
parent
commit
f8d104b861
2 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  1. 3 2
      src/proto/ProtoParser.cpp
  2. 1 1
      src/proto/jsonUtils.cpp

+ 3 - 2
src/proto/ProtoParser.cpp

@@ -682,6 +682,8 @@ unsigned char ProtoParser::parsePayload(std::string &payload, bool pub)
             PullMessageResult r;
             if (r.ParseFromArray(str.c_str(), str.length()))
             {
+                MqttLog(LOG_INFO, LOG_TYPE_FUNC, "LRM: %d", r.message_size());
+
                 p->update(r, _msgCurrent);
                 std::list<Message> messages;
                 toJson(r, _payload, messages);
@@ -1116,8 +1118,7 @@ std::string ProtoParser::pullMessagePack(std::string requestJson, uint32_t &msgI
         msgId = 0;
         return "";
     }
-    if (par.id() == 0)
-        par.set_id(_msgCurrent);
+   
     std::string str;
     par.SerializeToString(&str);
     str = dataEncrypt(str);

+ 1 - 1
src/proto/jsonUtils.cpp

@@ -987,7 +987,7 @@ bool parseJson(std::string &str, LoadRemoteMessages &par)
         copy(*conv, doc["conversation"]);
         par.set_allocated_conversation(conv);
     }
-    par.set_before_uid(doc["before_uid"].GetInt64());
+    par.set_before_uid(GetInt64(doc["before_uid"]));
     par.set_count(doc["count"].GetInt64());
     return true;
 }