mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
parent
0c6760d0ca
commit
ab0d70300c
|
@ -36,9 +36,9 @@ AbstractIrcServer::AbstractIrcServer()
|
||||||
QObject::connect(this->readConnection_.get(),
|
QObject::connect(this->readConnection_.get(),
|
||||||
&Communi::IrcConnection::privateMessageReceived,
|
&Communi::IrcConnection::privateMessageReceived,
|
||||||
[this](auto msg) { this->privateMessageReceived(msg); });
|
[this](auto msg) { this->privateMessageReceived(msg); });
|
||||||
QObject::connect(this->readConnection_.get(),
|
QObject::connect(
|
||||||
&Communi::IrcConnection::connected,
|
this->readConnection_.get(), &Communi::IrcConnection::connected,
|
||||||
[this] { this->onConnected(); });
|
[this] { this->onConnected(this->readConnection_.get()); });
|
||||||
QObject::connect(this->readConnection_.get(),
|
QObject::connect(this->readConnection_.get(),
|
||||||
&Communi::IrcConnection::disconnected,
|
&Communi::IrcConnection::disconnected,
|
||||||
[this] { this->onDisconnected(); });
|
[this] { this->onDisconnected(); });
|
||||||
|
@ -227,7 +227,7 @@ std::shared_ptr<Channel> AbstractIrcServer::getChannelOrEmpty(
|
||||||
return Channel::getEmpty();
|
return Channel::getEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractIrcServer::onConnected()
|
void AbstractIrcServer::onConnected(IrcConnection *connection)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(this->channelMutex);
|
std::lock_guard<std::mutex> lock(this->channelMutex);
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ protected:
|
||||||
virtual void messageReceived(Communi::IrcMessage *message);
|
virtual void messageReceived(Communi::IrcMessage *message);
|
||||||
virtual void writeConnectionMessageReceived(Communi::IrcMessage *message);
|
virtual void writeConnectionMessageReceived(Communi::IrcMessage *message);
|
||||||
|
|
||||||
virtual void onConnected();
|
virtual void onConnected(IrcConnection *connection);
|
||||||
virtual void onDisconnected();
|
virtual void onDisconnected();
|
||||||
virtual void onSocketError();
|
virtual void onSocketError();
|
||||||
|
|
||||||
|
|
|
@ -90,13 +90,6 @@ void TwitchServer::initializeConnection(IrcConnection *connection, bool isRead,
|
||||||
connection->setPassword(oauthToken);
|
connection->setPassword(oauthToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
connection->sendCommand(
|
|
||||||
Communi::IrcCommand::createCapability("REQ", "twitch.tv/membership"));
|
|
||||||
connection->sendCommand(
|
|
||||||
Communi::IrcCommand::createCapability("REQ", "twitch.tv/commands"));
|
|
||||||
connection->sendCommand(
|
|
||||||
Communi::IrcCommand::createCapability("REQ", "twitch.tv/tags"));
|
|
||||||
|
|
||||||
connection->setSecure(true);
|
connection->setSecure(true);
|
||||||
|
|
||||||
// https://dev.twitch.tv/docs/irc/guide/#connecting-to-twitch-irc
|
// https://dev.twitch.tv/docs/irc/guide/#connecting-to-twitch-irc
|
||||||
|
@ -206,6 +199,13 @@ void TwitchServer::writeConnectionMessageReceived(Communi::IrcMessage *message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TwitchServer::onConnected(IrcConnection *connection)
|
||||||
|
{
|
||||||
|
// connection in thise case is the read connection
|
||||||
|
connection->sendRaw(
|
||||||
|
"CAP REQ :twitch.tv/tags twitch.tv/commands twitch.tv/membership");
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<Channel> TwitchServer::getCustomChannel(
|
std::shared_ptr<Channel> TwitchServer::getCustomChannel(
|
||||||
const QString &channelName)
|
const QString &channelName)
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,6 +55,8 @@ protected:
|
||||||
virtual void writeConnectionMessageReceived(
|
virtual void writeConnectionMessageReceived(
|
||||||
Communi::IrcMessage *message) override;
|
Communi::IrcMessage *message) override;
|
||||||
|
|
||||||
|
virtual void onConnected(IrcConnection *connection) override;
|
||||||
|
|
||||||
virtual std::shared_ptr<Channel> getCustomChannel(
|
virtual std::shared_ptr<Channel> getCustomChannel(
|
||||||
const QString &channelname) override;
|
const QString &channelname) override;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue