|
@@ -1490,16 +1490,37 @@ std::string ProtoParser::getConversationInfo(std::string requestJson)
|
|
|
writer.Key("target");
|
|
|
writer.String(par.target().c_str());
|
|
|
|
|
|
+ int64_t timestamp = 0;
|
|
|
std::string types, lines;
|
|
|
types = "[" + std::to_string(par.type()) + "]";
|
|
|
lines = "[" + std::to_string(par.line()) + "]";
|
|
|
p->getConversation(nullptr, types.c_str(), lines.c_str(), [&](const auto &item) {
|
|
|
writer.Key("lastMessage");
|
|
|
toJson(writer, item);
|
|
|
-
|
|
|
- // TODO: isTop, isSilent, draft, unreadCount, timestamp
|
|
|
+ timestamp = item.server_timestamp();
|
|
|
return true;
|
|
|
});
|
|
|
+
|
|
|
+ writer.Key("isTop");
|
|
|
+ writer.Bool(p->isTop(par));
|
|
|
+ writer.Key("isSilent");
|
|
|
+ writer.Bool(p->isSilent(par));
|
|
|
+ writer.Key("draft");
|
|
|
+ writer.String(""); // TODO:
|
|
|
+ writer.Key("timestamp");
|
|
|
+ writer.Int64(timestamp);
|
|
|
+ writer.Key("unreadCount");
|
|
|
+ writer.StartObject();
|
|
|
+ writer.Key("unread");
|
|
|
+ int unread = 0, unreadMention = 0, unreadMentionAll = 0;
|
|
|
+ p->getUnread(par, _uid, unread, unreadMention, unreadMentionAll);
|
|
|
+ writer.Int(unread);
|
|
|
+ writer.Key("unreadMention");
|
|
|
+ writer.Int(unreadMention);
|
|
|
+ writer.Key("unreadMentionAll");
|
|
|
+ writer.Int(unreadMentionAll);
|
|
|
+ writer.EndObject();
|
|
|
+
|
|
|
writer.EndObject();
|
|
|
return buffer.GetString();
|
|
|
}
|