2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-04-12 17:46:44 +02:00
|
|
|
|
2017-06-11 09:31:45 +02:00
|
|
|
#include "channel.hpp"
|
2017-04-12 17:46:44 +02:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
2017-04-12 17:46:44 +02:00
|
|
|
|
|
|
|
class ChannelManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static ChannelManager &getInstance()
|
|
|
|
{
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
SharedChannel getWhispers();
|
|
|
|
SharedChannel getMentions();
|
|
|
|
SharedChannel getEmpty();
|
|
|
|
|
|
|
|
const std::vector<SharedChannel> getItems();
|
|
|
|
|
|
|
|
SharedChannel addChannel(const QString &channel);
|
|
|
|
SharedChannel getChannel(const QString &channel);
|
|
|
|
void removeChannel(const QString &channel);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static ChannelManager instance;
|
|
|
|
|
|
|
|
ChannelManager();
|
|
|
|
|
|
|
|
QMap<QString, std::tuple<SharedChannel, int>> _channels;
|
|
|
|
QMutex _channelsMutex;
|
|
|
|
|
|
|
|
SharedChannel _whispers;
|
|
|
|
SharedChannel _mentions;
|
|
|
|
SharedChannel _empty;
|
|
|
|
};
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
} // namespace chatterino
|