Repos
C++
432 B17 lines Opens in site
Directory
Raw
Download
#include "model/Conversation.hpp"
#include "core/JsonDecode.hpp"
namespace dp {
Conversation Conversation::fromJson(const Json& j) {
using D = JsonDecode;
Conversation c;
c.otherUser = User::fromJson(D::child(j, "other_user"));
c.lastMessage = D::req<std::string>(j, "last_message");
c.lastMessageAt = D::req<std::string>(j, "last_message_at");
c.unread = D::req<bool>(j, "unread");
return c;
}
} // namespace dp