|
@@ -1972,7 +1972,7 @@ std::string ProtoParser::getMessages(std::string requestJson)
|
|
valid = false;
|
|
valid = false;
|
|
}
|
|
}
|
|
before = doc["before"].GetBool();
|
|
before = doc["before"].GetBool();
|
|
- idx = doc["fromIndex"].GetUint64();
|
|
|
|
|
|
+ idx = GetInt64(doc["fromIndex"]);
|
|
count = doc["count"].GetInt();
|
|
count = doc["count"].GetInt();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1998,6 +1998,107 @@ std::string ProtoParser::getMessages(std::string requestJson)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+std::string ProtoParser::getAllConversations() const
|
|
|
|
+{
|
|
|
|
+ std::list<Conversation> items;
|
|
|
|
+ p->getAllConversations(items);
|
|
|
|
+
|
|
|
|
+ rapidjson::StringBuffer buffer;
|
|
|
|
+ rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
|
|
|
|
+ for (const auto &item : items)
|
|
|
|
+ {
|
|
|
|
+ toJson(writer, item);
|
|
|
|
+ }
|
|
|
|
+ auto ret = buffer.GetString();
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+std::string ProtoParser::getAllUserSettings() const
|
|
|
|
+{
|
|
|
|
+ std::list<UserSettingEntry> items;
|
|
|
|
+ p->getAllUserSettings(items);
|
|
|
|
+
|
|
|
|
+ rapidjson::StringBuffer buffer;
|
|
|
|
+ rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
|
|
|
|
+ for (const auto &item : items)
|
|
|
|
+ {
|
|
|
|
+ toJson(writer, item);
|
|
|
|
+ }
|
|
|
|
+ auto ret = buffer.GetString();
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+std::string ProtoParser::getAllMessages() const
|
|
|
|
+{
|
|
|
|
+ std::list<Message> items;
|
|
|
|
+ p->getAllMessages(items);
|
|
|
|
+
|
|
|
|
+ rapidjson::StringBuffer buffer;
|
|
|
|
+ rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
|
|
|
|
+ for (const auto &item : items)
|
|
|
|
+ {
|
|
|
|
+ toJson(writer, item);
|
|
|
|
+ }
|
|
|
|
+ auto ret = buffer.GetString();
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+std::string ProtoParser::getAllUsers() const
|
|
|
|
+{
|
|
|
|
+ std::list<User> items;
|
|
|
|
+ p->getAllUsers(items);
|
|
|
|
+
|
|
|
|
+ rapidjson::StringBuffer buffer;
|
|
|
|
+ rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
|
|
|
|
+ for (const auto &item : items)
|
|
|
|
+ {
|
|
|
|
+ toJson(writer, item);
|
|
|
|
+ }
|
|
|
|
+ auto ret = buffer.GetString();
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+std::string ProtoParser::getAllFriends() const
|
|
|
|
+{
|
|
|
|
+ std::list<Friend> items;
|
|
|
|
+ p->getAllFriends(items);
|
|
|
|
+
|
|
|
|
+ rapidjson::StringBuffer buffer;
|
|
|
|
+ rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
|
|
|
|
+ for (const auto &item : items)
|
|
|
|
+ {
|
|
|
|
+ toJson(writer, item);
|
|
|
|
+ }
|
|
|
|
+ auto ret = buffer.GetString();
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+std::string ProtoParser::getAllFriendRequests() const
|
|
|
|
+{
|
|
|
|
+ std::list<FriendRequest> items;
|
|
|
|
+ p->getAllFriendRequests(items);
|
|
|
|
+
|
|
|
|
+ rapidjson::StringBuffer buffer;
|
|
|
|
+ rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
|
|
|
|
+ for (const auto &item : items)
|
|
|
|
+ {
|
|
|
|
+ toJson(writer, item, _uid);
|
|
|
|
+ }
|
|
|
|
+ auto ret = buffer.GetString();
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+std::string ProtoParser::getAllGroups() const
|
|
|
|
+{
|
|
|
|
+ std::list<GroupInfo> items;
|
|
|
|
+ p->getAllGroups(items);
|
|
|
|
+
|
|
|
|
+ rapidjson::StringBuffer buffer;
|
|
|
|
+ rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
|
|
|
|
+ for (const auto &item : items)
|
|
|
|
+ {
|
|
|
|
+ toJson(writer, item);
|
|
|
|
+ }
|
|
|
|
+ auto ret = buffer.GetString();
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+
|
|
#ifdef USE_WASM
|
|
#ifdef USE_WASM
|
|
|
|
|
|
void ProtoParser::setOnConnected(int ptr)
|
|
void ProtoParser::setOnConnected(int ptr)
|