2018-06-26 14:09:39 +02:00
|
|
|
#include "AbstractIrcServer.hpp"
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-08-11 22:23:06 +02:00
|
|
|
#include "common/Channel.hpp"
|
2018-06-26 15:33:51 +02:00
|
|
|
#include "common/Common.hpp"
|
2018-08-11 22:23:06 +02:00
|
|
|
#include "debug/Log.hpp"
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "messages/LimitedQueueSnapshot.hpp"
|
|
|
|
#include "messages/Message.hpp"
|
2018-08-07 01:35:24 +02:00
|
|
|
#include "messages/MessageBuilder.hpp"
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-06-04 21:05:18 +02:00
|
|
|
#include <QCoreApplication>
|
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
namespace chatterino {
|
|
|
|
|
2018-10-13 15:45:13 +02:00
|
|
|
const int RECONNECT_BASE_INTERVAL = 2000;
|
|
|
|
// 60 falloff counter means it will try to reconnect at most every 60*2 seconds
|
|
|
|
const int MAX_FALLOFF_COUNTER = 60;
|
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
AbstractIrcServer::AbstractIrcServer()
|
|
|
|
{
|
|
|
|
// Initialize the connections
|
2019-09-09 22:22:47 +02:00
|
|
|
// XXX: don't create write connection if there is not separate write connection.
|
2018-06-22 23:24:45 +02:00
|
|
|
this->writeConnection_.reset(new IrcConnection);
|
2018-08-06 21:17:03 +02:00
|
|
|
this->writeConnection_->moveToThread(
|
|
|
|
QCoreApplication::instance()->thread());
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-08-06 21:17:03 +02:00
|
|
|
QObject::connect(
|
|
|
|
this->writeConnection_.get(), &Communi::IrcConnection::messageReceived,
|
2019-09-09 22:22:47 +02:00
|
|
|
this, [this](auto msg) { this->writeConnectionMessageReceived(msg); });
|
|
|
|
QObject::connect(
|
|
|
|
this->writeConnection_.get(), &Communi::IrcConnection::connected, this,
|
|
|
|
[this] { this->onWriteConnected(this->writeConnection_.get()); });
|
2018-02-05 15:11:50 +01:00
|
|
|
|
|
|
|
// Listen to read connection message signals
|
2018-06-22 23:24:45 +02:00
|
|
|
this->readConnection_.reset(new IrcConnection);
|
|
|
|
this->readConnection_->moveToThread(QCoreApplication::instance()->thread());
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2019-08-31 17:44:41 +02:00
|
|
|
QObject::connect(
|
|
|
|
this->readConnection_.get(), &Communi::IrcConnection::messageReceived,
|
2019-09-09 22:22:47 +02:00
|
|
|
this, [this](auto msg) { this->readConnectionMessageReceived(msg); });
|
2018-08-06 21:17:03 +02:00
|
|
|
QObject::connect(this->readConnection_.get(),
|
2019-09-09 22:22:47 +02:00
|
|
|
&Communi::IrcConnection::privateMessageReceived, this,
|
2018-02-05 15:11:50 +01:00
|
|
|
[this](auto msg) { this->privateMessageReceived(msg); });
|
2019-08-22 22:04:02 +02:00
|
|
|
QObject::connect(
|
2019-09-09 22:22:47 +02:00
|
|
|
this->readConnection_.get(), &Communi::IrcConnection::connected, this,
|
2019-08-27 20:45:42 +02:00
|
|
|
[this] { this->onReadConnected(this->readConnection_.get()); });
|
2018-08-06 21:17:03 +02:00
|
|
|
QObject::connect(this->readConnection_.get(),
|
2019-09-09 22:22:47 +02:00
|
|
|
&Communi::IrcConnection::disconnected, this,
|
2018-02-05 15:11:50 +01:00
|
|
|
[this] { this->onDisconnected(); });
|
2018-10-13 15:45:13 +02:00
|
|
|
QObject::connect(this->readConnection_.get(),
|
2019-09-09 22:22:47 +02:00
|
|
|
&Communi::IrcConnection::socketError, this,
|
2018-10-13 15:45:13 +02:00
|
|
|
[this] { this->onSocketError(); });
|
2018-06-04 21:37:19 +02:00
|
|
|
|
|
|
|
// listen to reconnect request
|
2018-08-06 21:17:03 +02:00
|
|
|
this->readConnection_->reconnectRequested.connect(
|
|
|
|
[this] { this->connect(); });
|
|
|
|
// this->writeConnection->reconnectRequested.connect([this] {
|
|
|
|
// this->connect(); });
|
2018-10-13 15:45:13 +02:00
|
|
|
this->reconnectTimer_.setInterval(RECONNECT_BASE_INTERVAL);
|
|
|
|
this->reconnectTimer_.setSingleShot(true);
|
|
|
|
QObject::connect(&this->reconnectTimer_, &QTimer::timeout, [this] {
|
|
|
|
this->reconnectTimer_.setInterval(RECONNECT_BASE_INTERVAL *
|
|
|
|
this->falloffCounter_);
|
|
|
|
|
|
|
|
this->falloffCounter_ =
|
|
|
|
std::min(MAX_FALLOFF_COUNTER, this->falloffCounter_ + 1);
|
|
|
|
|
2018-10-21 13:43:02 +02:00
|
|
|
if (!this->readConnection_->isConnected())
|
|
|
|
{
|
2018-10-13 15:45:13 +02:00
|
|
|
log("Trying to reconnect... {}", this->falloffCounter_);
|
|
|
|
this->connect();
|
|
|
|
}
|
|
|
|
});
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void AbstractIrcServer::connect()
|
|
|
|
{
|
|
|
|
this->disconnect();
|
|
|
|
|
2019-09-09 22:22:47 +02:00
|
|
|
if (this->hasSeparateWriteConnection())
|
2018-10-21 13:43:02 +02:00
|
|
|
{
|
2019-09-14 20:45:01 +02:00
|
|
|
this->initializeConnection(this->writeConnection_.get(), Write);
|
|
|
|
this->initializeConnection(this->readConnection_.get(), Read);
|
2018-10-21 13:43:02 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-14 20:45:01 +02:00
|
|
|
this->initializeConnection(this->readConnection_.get(), Both);
|
2018-07-16 17:23:41 +02:00
|
|
|
}
|
2019-09-14 20:45:01 +02:00
|
|
|
}
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2019-09-14 20:45:01 +02:00
|
|
|
void AbstractIrcServer::open(ConnectionType type)
|
|
|
|
{
|
2019-09-15 11:35:17 +02:00
|
|
|
std::lock_guard<std::mutex> lock(this->connectionMutex_);
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2019-09-14 20:45:01 +02:00
|
|
|
if (type == Write)
|
|
|
|
{
|
|
|
|
this->writeConnection_->open();
|
|
|
|
}
|
|
|
|
if (type & Read)
|
|
|
|
{
|
2018-06-22 23:24:45 +02:00
|
|
|
this->readConnection_->open();
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void AbstractIrcServer::disconnect()
|
|
|
|
{
|
2018-06-22 23:24:45 +02:00
|
|
|
std::lock_guard<std::mutex> locker(this->connectionMutex_);
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-06-22 23:24:45 +02:00
|
|
|
this->readConnection_->close();
|
2019-09-09 22:22:47 +02:00
|
|
|
if (this->hasSeparateWriteConnection())
|
|
|
|
{
|
|
|
|
this->writeConnection_->close();
|
|
|
|
}
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
|
|
|
|
2018-08-06 21:17:03 +02:00
|
|
|
void AbstractIrcServer::sendMessage(const QString &channelName,
|
|
|
|
const QString &message)
|
2018-02-05 15:11:50 +01:00
|
|
|
{
|
2018-07-16 17:23:41 +02:00
|
|
|
this->sendRawMessage("PRIVMSG #" + channelName + " :" + message);
|
|
|
|
}
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-07-16 17:23:41 +02:00
|
|
|
void AbstractIrcServer::sendRawMessage(const QString &rawMessage)
|
|
|
|
{
|
|
|
|
std::lock_guard<std::mutex> locker(this->connectionMutex_);
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-10-21 13:43:02 +02:00
|
|
|
if (this->hasSeparateWriteConnection())
|
|
|
|
{
|
2018-07-16 17:23:41 +02:00
|
|
|
this->writeConnection_->sendRaw(rawMessage);
|
2018-10-21 13:43:02 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-07-16 17:23:41 +02:00
|
|
|
this->readConnection_->sendRaw(rawMessage);
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-06 21:17:03 +02:00
|
|
|
void AbstractIrcServer::writeConnectionMessageReceived(
|
|
|
|
Communi::IrcMessage *message)
|
2018-02-05 15:11:50 +01:00
|
|
|
{
|
2019-09-09 22:22:47 +02:00
|
|
|
(void)message;
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
|
|
|
|
2019-09-09 22:22:47 +02:00
|
|
|
ChannelPtr AbstractIrcServer::getOrAddChannel(const QString &dirtyChannelName)
|
2018-02-05 15:11:50 +01:00
|
|
|
{
|
2018-04-21 00:40:17 +02:00
|
|
|
auto channelName = this->cleanChannelName(dirtyChannelName);
|
2018-04-01 15:10:15 +02:00
|
|
|
|
2018-02-05 21:20:38 +01:00
|
|
|
// try get channel
|
2018-04-21 00:40:17 +02:00
|
|
|
ChannelPtr chan = this->getChannelOrEmpty(channelName);
|
2018-10-21 13:43:02 +02:00
|
|
|
if (chan != Channel::getEmpty())
|
|
|
|
{
|
2018-02-05 21:20:38 +01:00
|
|
|
return chan;
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
|
|
|
|
2018-02-05 21:20:38 +01:00
|
|
|
std::lock_guard<std::mutex> lock(this->channelMutex);
|
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
// value doesn't exist
|
2018-02-05 21:20:38 +01:00
|
|
|
chan = this->createChannel(channelName);
|
2018-10-21 13:43:02 +02:00
|
|
|
if (!chan)
|
|
|
|
{
|
2018-02-05 15:11:50 +01:00
|
|
|
return Channel::getEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
this->channels.insert(channelName, chan);
|
2019-09-11 13:17:36 +02:00
|
|
|
this->connections_.emplace_back(chan->destroyed.connect([this,
|
|
|
|
channelName] {
|
2018-02-05 21:20:38 +01:00
|
|
|
// fourtf: issues when the server itself is destroyed
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2019-09-11 13:17:36 +02:00
|
|
|
log("[AbstractIrcServer::addChannel] {} was destroyed", channelName);
|
|
|
|
this->channels.remove(channelName);
|
2018-04-21 00:40:17 +02:00
|
|
|
|
2018-10-21 13:43:02 +02:00
|
|
|
if (this->readConnection_)
|
|
|
|
{
|
2019-09-11 13:17:36 +02:00
|
|
|
this->readConnection_->sendRaw("PART #" + channelName);
|
2018-04-21 00:40:17 +02:00
|
|
|
}
|
|
|
|
|
2019-09-09 22:22:47 +02:00
|
|
|
if (this->writeConnection_ && this->hasSeparateWriteConnection())
|
2018-10-21 13:43:02 +02:00
|
|
|
{
|
2019-09-11 13:17:36 +02:00
|
|
|
this->writeConnection_->sendRaw("PART #" + channelName);
|
2018-04-21 00:40:17 +02:00
|
|
|
}
|
2019-09-11 13:17:36 +02:00
|
|
|
}));
|
2018-02-05 15:11:50 +01:00
|
|
|
|
|
|
|
// join irc channel
|
|
|
|
{
|
2018-06-22 23:24:45 +02:00
|
|
|
std::lock_guard<std::mutex> lock2(this->connectionMutex_);
|
2018-02-05 21:20:38 +01:00
|
|
|
|
2018-10-21 13:43:02 +02:00
|
|
|
if (this->readConnection_)
|
|
|
|
{
|
2019-09-11 13:17:36 +02:00
|
|
|
if (this->readConnection_->isConnected())
|
|
|
|
{
|
|
|
|
this->readConnection_->sendRaw("JOIN #" + channelName);
|
|
|
|
}
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
|
|
|
|
2019-09-09 22:22:47 +02:00
|
|
|
if (this->writeConnection_ && this->hasSeparateWriteConnection())
|
2018-10-21 13:43:02 +02:00
|
|
|
{
|
2019-09-11 13:17:36 +02:00
|
|
|
if (this->readConnection_->isConnected())
|
|
|
|
{
|
|
|
|
this->writeConnection_->sendRaw("JOIN #" + channelName);
|
|
|
|
}
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return chan;
|
|
|
|
}
|
|
|
|
|
2019-09-09 22:22:47 +02:00
|
|
|
ChannelPtr AbstractIrcServer::getChannelOrEmpty(const QString &dirtyChannelName)
|
2018-02-05 15:11:50 +01:00
|
|
|
{
|
2018-04-21 00:40:17 +02:00
|
|
|
auto channelName = this->cleanChannelName(dirtyChannelName);
|
2018-04-01 15:10:15 +02:00
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
std::lock_guard<std::mutex> lock(this->channelMutex);
|
|
|
|
|
2018-02-05 21:20:38 +01:00
|
|
|
// try get special channel
|
|
|
|
ChannelPtr chan = this->getCustomChannel(channelName);
|
2018-10-21 13:43:02 +02:00
|
|
|
if (chan)
|
|
|
|
{
|
2018-02-05 21:20:38 +01:00
|
|
|
return chan;
|
|
|
|
}
|
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
// value exists
|
|
|
|
auto it = this->channels.find(channelName);
|
2018-10-21 13:43:02 +02:00
|
|
|
if (it != this->channels.end())
|
|
|
|
{
|
2018-02-05 21:20:38 +01:00
|
|
|
chan = it.value().lock();
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-10-21 13:43:02 +02:00
|
|
|
if (chan)
|
|
|
|
{
|
2018-02-05 15:11:50 +01:00
|
|
|
return chan;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return Channel::getEmpty();
|
|
|
|
}
|
|
|
|
|
2019-09-09 22:22:47 +02:00
|
|
|
std::vector<std::weak_ptr<Channel>> AbstractIrcServer::getChannels()
|
|
|
|
{
|
|
|
|
std::lock_guard lock(this->channelMutex);
|
|
|
|
std::vector<std::weak_ptr<Channel>> channels;
|
|
|
|
|
|
|
|
for (auto &&weak : this->channels.values())
|
|
|
|
{
|
|
|
|
channels.push_back(weak);
|
|
|
|
}
|
|
|
|
|
|
|
|
return channels;
|
|
|
|
}
|
|
|
|
|
2019-08-27 20:45:42 +02:00
|
|
|
void AbstractIrcServer::onReadConnected(IrcConnection *connection)
|
2018-02-05 15:11:50 +01:00
|
|
|
{
|
2019-09-09 22:22:47 +02:00
|
|
|
(void)connection;
|
|
|
|
|
|
|
|
std::lock_guard lock(this->channelMutex);
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2019-09-14 20:45:01 +02:00
|
|
|
// join channels
|
|
|
|
for (auto &&weak : this->channels)
|
|
|
|
{
|
|
|
|
if (auto channel = weak.lock())
|
|
|
|
{
|
|
|
|
connection->sendRaw("JOIN #" + channel->getName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// connected/disconnected message
|
2019-05-08 08:51:14 +02:00
|
|
|
auto connectedMsg = makeSystemMessage("connected");
|
|
|
|
connectedMsg->flags.set(MessageFlag::ConnectedMessage);
|
2018-12-04 21:07:55 +01:00
|
|
|
auto reconnected = makeSystemMessage("reconnected");
|
|
|
|
reconnected->flags.set(MessageFlag::ConnectedMessage);
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-10-21 13:43:02 +02:00
|
|
|
for (std::weak_ptr<Channel> &weak : this->channels.values())
|
|
|
|
{
|
2018-02-05 15:11:50 +01:00
|
|
|
std::shared_ptr<Channel> chan = weak.lock();
|
2018-10-21 13:43:02 +02:00
|
|
|
if (!chan)
|
|
|
|
{
|
2018-02-05 15:11:50 +01:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
LimitedQueueSnapshot<MessagePtr> snapshot = chan->getMessageSnapshot();
|
|
|
|
|
2018-12-04 21:07:55 +01:00
|
|
|
bool replaceMessage =
|
|
|
|
snapshot.size() > 0 && snapshot[snapshot.size() - 1]->flags.has(
|
|
|
|
MessageFlag::DisconnectedMessage);
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-10-21 13:43:02 +02:00
|
|
|
if (replaceMessage)
|
|
|
|
{
|
2018-12-04 21:07:55 +01:00
|
|
|
chan->replaceMessage(snapshot[snapshot.size() - 1], reconnected);
|
2018-02-05 15:11:50 +01:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2019-05-08 08:51:14 +02:00
|
|
|
chan->addMessage(connectedMsg);
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
2018-10-13 15:45:13 +02:00
|
|
|
|
|
|
|
this->falloffCounter_ = 1;
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
|
|
|
|
2019-08-27 20:45:42 +02:00
|
|
|
void AbstractIrcServer::onWriteConnected(IrcConnection *connection)
|
|
|
|
{
|
2019-09-09 22:22:47 +02:00
|
|
|
(void)connection;
|
2019-08-27 20:45:42 +02:00
|
|
|
}
|
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
void AbstractIrcServer::onDisconnected()
|
|
|
|
{
|
|
|
|
std::lock_guard<std::mutex> lock(this->channelMutex);
|
|
|
|
|
2018-12-04 21:07:55 +01:00
|
|
|
MessageBuilder b(systemMessage, "disconnected");
|
2018-08-07 07:55:31 +02:00
|
|
|
b->flags.set(MessageFlag::DisconnectedMessage);
|
2019-05-08 08:51:14 +02:00
|
|
|
auto disconnectedMsg = b.release();
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-10-21 13:43:02 +02:00
|
|
|
for (std::weak_ptr<Channel> &weak : this->channels.values())
|
|
|
|
{
|
2018-02-05 15:11:50 +01:00
|
|
|
std::shared_ptr<Channel> chan = weak.lock();
|
2018-10-21 13:43:02 +02:00
|
|
|
if (!chan)
|
|
|
|
{
|
2018-02-05 15:11:50 +01:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2019-05-08 08:51:14 +02:00
|
|
|
chan->addMessage(disconnectedMsg);
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-13 15:45:13 +02:00
|
|
|
void AbstractIrcServer::onSocketError()
|
|
|
|
{
|
|
|
|
this->reconnectTimer_.start();
|
|
|
|
}
|
|
|
|
|
2018-08-06 21:17:03 +02:00
|
|
|
std::shared_ptr<Channel> AbstractIrcServer::getCustomChannel(
|
|
|
|
const QString &channelName)
|
2018-02-05 15:11:50 +01:00
|
|
|
{
|
2019-09-09 22:22:47 +02:00
|
|
|
(void)channelName;
|
2018-02-05 15:11:50 +01:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2018-04-21 00:40:17 +02:00
|
|
|
QString AbstractIrcServer::cleanChannelName(const QString &dirtyChannelName)
|
2018-04-01 15:10:15 +02:00
|
|
|
{
|
|
|
|
return dirtyChannelName;
|
|
|
|
}
|
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
void AbstractIrcServer::addFakeMessage(const QString &data)
|
|
|
|
{
|
2018-08-06 21:17:03 +02:00
|
|
|
auto fakeMessage = Communi::IrcMessage::fromData(
|
|
|
|
data.toUtf8(), this->readConnection_.get());
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2018-10-21 13:43:02 +02:00
|
|
|
if (fakeMessage->command() == "PRIVMSG")
|
|
|
|
{
|
2018-08-06 21:17:03 +02:00
|
|
|
this->privateMessageReceived(
|
|
|
|
static_cast<Communi::IrcPrivateMessage *>(fakeMessage));
|
2018-10-21 13:43:02 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-08-31 17:44:41 +02:00
|
|
|
this->readConnectionMessageReceived(fakeMessage);
|
2018-06-24 16:24:40 +02:00
|
|
|
}
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
|
|
|
|
2018-08-06 21:17:03 +02:00
|
|
|
void AbstractIrcServer::privateMessageReceived(
|
|
|
|
Communi::IrcPrivateMessage *message)
|
2018-02-05 15:11:50 +01:00
|
|
|
{
|
2019-09-09 22:22:47 +02:00
|
|
|
(void)message;
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
|
|
|
|
2019-08-31 17:44:41 +02:00
|
|
|
void AbstractIrcServer::readConnectionMessageReceived(
|
|
|
|
Communi::IrcMessage *message)
|
2018-02-05 15:11:50 +01:00
|
|
|
{
|
2019-09-09 22:22:47 +02:00
|
|
|
(void)message;
|
2018-02-05 15:11:50 +01:00
|
|
|
}
|
2018-02-05 21:20:38 +01:00
|
|
|
|
|
|
|
void AbstractIrcServer::forEachChannel(std::function<void(ChannelPtr)> func)
|
|
|
|
{
|
|
|
|
std::lock_guard<std::mutex> lock(this->channelMutex);
|
|
|
|
|
2018-10-21 13:43:02 +02:00
|
|
|
for (std::weak_ptr<Channel> &weak : this->channels.values())
|
|
|
|
{
|
2019-09-09 22:22:47 +02:00
|
|
|
ChannelPtr chan = weak.lock();
|
2018-10-21 13:43:02 +02:00
|
|
|
if (!chan)
|
|
|
|
{
|
2018-02-05 21:20:38 +01:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
func(chan);
|
|
|
|
}
|
|
|
|
}
|
2018-04-01 16:43:30 +02:00
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
} // namespace chatterino
|