#pragma once #include "messages/image.hpp" #include "messages/limitedqueue.hpp" #include "messages/message.hpp" #include "util/completionmodel.hpp" #include "util/concurrentmap.hpp" #include #include #include namespace chatterino { namespace messages { struct Message; } class Channel : public std::enable_shared_from_this { public: explicit Channel(const QString &_name); virtual ~Channel(); pajlada::Signals::Signal sendMessageSignal; boost::signals2::signal messageRemovedFromStart; boost::signals2::signal messageAppended; boost::signals2::signal &)> messagesAddedAtStart; boost::signals2::signal messageReplaced; pajlada::Signals::NoArgSignal destroyed; virtual bool isEmpty() const; messages::LimitedQueueSnapshot getMessageSnapshot(); void addMessage(messages::MessagePtr message); void addMessagesAtStart(std::vector &messages); void replaceMessage(messages::MessagePtr message, messages::MessagePtr replacement); virtual void addRecentChatter(const std::shared_ptr &message); QString name; QStringList modList; virtual bool canSendMessage() const; virtual void sendMessage(const QString &message); virtual bool isMod() const { return false; } static std::shared_ptr getEmpty(); CompletionModel completionModel; protected: virtual void onConnected(); private: messages::LimitedQueue messages; }; using ChannelPtr = std::shared_ptr; } // namespace chatterino