mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Fix USERSTATE not being handled unless you write in a channel.
This commit might re-enable some duplicate messages like host requests and what-not.
This commit is contained in:
parent
8c58383298
commit
8312d4b112
1 changed files with 15 additions and 5 deletions
|
@ -156,6 +156,11 @@ void TwitchIrcServer::readConnectionMessageReceived(
|
||||||
{
|
{
|
||||||
handler.handlePartMessage(message);
|
handler.handlePartMessage(message);
|
||||||
}
|
}
|
||||||
|
else if (command == "USERSTATE")
|
||||||
|
{
|
||||||
|
// Received USERSTATE upon JOINing a channel
|
||||||
|
handler.handleUserStateMessage(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TwitchIrcServer::writeConnectionMessageReceived(
|
void TwitchIrcServer::writeConnectionMessageReceived(
|
||||||
|
@ -168,6 +173,7 @@ void TwitchIrcServer::writeConnectionMessageReceived(
|
||||||
// Below commands enabled through the twitch.tv/commands CAP REQ
|
// Below commands enabled through the twitch.tv/commands CAP REQ
|
||||||
if (command == "USERSTATE")
|
if (command == "USERSTATE")
|
||||||
{
|
{
|
||||||
|
// Received USERSTATE upon PRIVMSGing
|
||||||
handler.handleUserStateMessage(message);
|
handler.handleUserStateMessage(message);
|
||||||
}
|
}
|
||||||
else if (command == "WHISPER")
|
else if (command == "WHISPER")
|
||||||
|
@ -199,20 +205,24 @@ void TwitchIrcServer::writeConnectionMessageReceived(
|
||||||
|
|
||||||
void TwitchIrcServer::onReadConnected(IrcConnection *connection)
|
void TwitchIrcServer::onReadConnected(IrcConnection *connection)
|
||||||
{
|
{
|
||||||
AbstractIrcServer::onReadConnected(connection);
|
|
||||||
|
|
||||||
// twitch.tv/tags enables IRCv3 tags on messages. See https://dev.twitch.tv/docs/irc/tags/
|
// twitch.tv/tags enables IRCv3 tags on messages. See https://dev.twitch.tv/docs/irc/tags/
|
||||||
// twitch.tv/membership enables the JOIN/PART/MODE/NAMES commands. See https://dev.twitch.tv/docs/irc/membership/
|
// twitch.tv/membership enables the JOIN/PART/MODE/NAMES commands. See https://dev.twitch.tv/docs/irc/membership/
|
||||||
connection->sendRaw("CAP REQ :twitch.tv/tags twitch.tv/membership");
|
// twitch.tv/commands enables a bunch of miscellaneous command capabilities. See https://dev.twitch.tv/docs/irc/commands/
|
||||||
|
// This is enabled here so we receive USERSTATE messages when joining channels
|
||||||
|
connection->sendRaw(
|
||||||
|
"CAP REQ :twitch.tv/tags twitch.tv/membership twitch.tv/commands");
|
||||||
|
|
||||||
|
AbstractIrcServer::onReadConnected(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TwitchIrcServer::onWriteConnected(IrcConnection *connection)
|
void TwitchIrcServer::onWriteConnected(IrcConnection *connection)
|
||||||
{
|
{
|
||||||
AbstractIrcServer::onWriteConnected(connection);
|
|
||||||
|
|
||||||
// twitch.tv/tags enables IRCv3 tags on messages. See https://dev.twitch.tv/docs/irc/tags/
|
// twitch.tv/tags enables IRCv3 tags on messages. See https://dev.twitch.tv/docs/irc/tags/
|
||||||
// twitch.tv/commands enables a bunch of miscellaneous command capabilities. See https://dev.twitch.tv/docs/irc/commands/
|
// twitch.tv/commands enables a bunch of miscellaneous command capabilities. See https://dev.twitch.tv/docs/irc/commands/
|
||||||
|
// This is enabled here so we receive USERSTATE messages when typing messages, along with the other command capabilities
|
||||||
connection->sendRaw("CAP REQ :twitch.tv/tags twitch.tv/commands");
|
connection->sendRaw("CAP REQ :twitch.tv/tags twitch.tv/commands");
|
||||||
|
|
||||||
|
AbstractIrcServer::onWriteConnected(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Channel> TwitchIrcServer::getCustomChannel(
|
std::shared_ptr<Channel> TwitchIrcServer::getCustomChannel(
|
||||||
|
|
Loading…
Reference in a new issue