#pragma once #include "logging/loggingchannel.hpp" #include "messages/lazyloadedimage.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::SharedMessage message); void addMessagesAtStart(std::vector &messages); void replaceMessage(messages::SharedMessage message, messages::SharedMessage 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; }; } // namespace chatterino