Skip to content
Repos

DevPlaceApp

C++ 619 B26 lines Opens in site

Directory Raw Download

#pragma once
// Spec: models.md MessagesInbox. other_last_seen stays a raw string.
#include <optional>
#include <string>
#include <vector>

#include "core/Json.hpp"
#include "model/Conversation.hpp"
#include "model/Message.hpp"
#include "model/User.hpp"

namespace dp {

struct MessagesInbox {
  std::vector<Conversation> conversations;
  std::vector<Message> messages;
  std::optional<User> otherUser;
  std::optional<std::string> currentConversation;
  std::string search;
  bool otherOnline = false;
  std::optional<std::string> otherLastSeen;

  static MessagesInbox fromJson(const Json& j);
};

}  // namespace dp
39.0ms