#pragma once #include "logging/loggingchannel.hpp" #include "messages/image.hpp" #include "messages/limitedqueue.hpp" #include "util/concurrentmap.hpp" #include #include #include #include #include #include #include namespace chatterino { namespace messages { class Message; } class Channel : public std::enable_shared_from_this { public: explicit Channel(const QString &_name); boost::signals2::signal messageRemovedFromStart; boost::signals2::signal messageAppended; boost::signals2::signal &)> messagesAddedAtStart; boost::signals2::signal messageReplaced; 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); private: messages::LimitedQueue messages; // std::shared_ptr loggingChannel; }; typedef std::shared_ptr SharedChannel; } // namespace chatterino