#pragma once #include "channel.hpp" #include "channeldata.hpp" #include "twitch/twitchchannel.hpp" #include namespace chatterino { namespace singletons { class IrcManager; class ChannelManager { explicit ChannelManager(); public: static ChannelManager &getInstance(); const std::vector> getItems(); std::shared_ptr addTwitchChannel(const QString &channel); std::shared_ptr getTwitchChannel(const QString &channel); void removeTwitchChannel(const QString &channel); const std::string &getUserID(const std::string &username); void doOnAll(std::function)> func); // Special channels const std::shared_ptr whispersChannel; const std::shared_ptr mentionsChannel; const std::shared_ptr emptyChannel; private: std::map usernameToID; std::map channelDatas; QMutex channelsMutex; QMap, int>> twitchChannels; pajlada::Signals::Signal ircJoin; pajlada::Signals::Signal ircPart; friend class singletons::IrcManager; }; } // namespace chatterino }