diff --git a/CHANGELOG.md b/CHANGELOG.md
index 116d9e20692..ef5464f9ba9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -92,6 +92,7 @@
- Dev: Refactored `static`s in headers to only be present once in the final app. (#5588)
- Dev: Refactored legacy Unicode zero-width-joiner replacement. (#5594)
- Dev: The JSON output when copying a message (SHIFT + right-click) is now more extensive. (#5600)
+- Dev: Twitch messages are now sent using Twitch's Helix API instead of IRC by default. (#5607)
## 2.5.1
diff --git a/src/providers/twitch/TwitchIrcServer.cpp b/src/providers/twitch/TwitchIrcServer.cpp
index 6c3e6ae50e9..c6541a95cb9 100644
--- a/src/providers/twitch/TwitchIrcServer.cpp
+++ b/src/providers/twitch/TwitchIrcServer.cpp
@@ -132,14 +132,14 @@ bool shouldSendHelixChat()
{
switch (getSettings()->chatSendProtocol)
{
+ case ChatSendProtocol::Default:
case ChatSendProtocol::Helix:
return true;
- case ChatSendProtocol::Default:
case ChatSendProtocol::IRC:
return false;
default:
assert(false && "Invalid chat protocol value");
- return false;
+ return true;
}
}
diff --git a/src/providers/twitch/api/Helix.cpp b/src/providers/twitch/api/Helix.cpp
index 6844a2dccbc..a756a0f47a2 100644
--- a/src/providers/twitch/api/Helix.cpp
+++ b/src/providers/twitch/api/Helix.cpp
@@ -9,6 +9,7 @@
#include
#include
+#include
namespace {
@@ -3015,8 +3016,13 @@ void Helix::sendChatMessage(
}
const auto obj = result.parseJson();
- auto message =
- obj["message"].toString(u"Twitch internal server error"_s);
+ auto message = obj["message"].toString();
+
+ if (message.isEmpty())
+ {
+ message = u"Twitch internal server error (" %
+ result.formatError() % ')';
+ }
switch (*result.status())
{