#pragma once #include "messages/image.hpp" #include "messages/limitedqueue.hpp" #include "messages/message.hpp" #include "singletons/helper/completionmodel.hpp" #include "util/concurrentmap.hpp" #include #include #include #include #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); void addRecentChatter(const std::shared_ptr &message); struct NameOptions { QString displayName; QString localizedName; }; std::vector getUsernamesForCompletions(); QString name; QStringList modList; // Key = login name std::map recentChatters; std::mutex recentChattersMutex; virtual bool canSendMessage() const; virtual void sendMessage(const QString &message); virtual bool isMod() const { return false; } static std::shared_ptr getEmpty(); singletons::CompletionModel completionModel; protected: virtual void onConnected(); private: messages::LimitedQueue messages; }; typedef std::shared_ptr ChannelPtr; } // namespace chatterino