#pragma once #include #include #include namespace chatterino { struct Message; class MessageThread { public: MessageThread(std::shared_ptr rootMessage); ~MessageThread(); void addToThread(const std::shared_ptr &message); void addToThread(const std::weak_ptr &message); /// Returns the number of live reply references size_t liveCount() const; /// Returns the number of live reply references size_t liveCount(const std::shared_ptr &exclude) const; bool participated() const; void markParticipated(); const QString &rootId() const { return rootMessageId_; } const std::shared_ptr &root() const { return rootMessage_; } const std::vector> &replies() const { return replies_; } private: const QString rootMessageId_; const std::shared_ptr rootMessage_; std::vector> replies_; bool participated_ = false; }; } // namespace chatterino