feat: send messages over Helix by default (#5607)
This commit is contained in:
@@ -92,6 +92,7 @@
|
|||||||
- Dev: Refactored `static`s in headers to only be present once in the final app. (#5588)
|
- 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: Refactored legacy Unicode zero-width-joiner replacement. (#5594)
|
||||||
- Dev: The JSON output when copying a message (<kbd>SHIFT</kbd> + right-click) is now more extensive. (#5600)
|
- Dev: The JSON output when copying a message (<kbd>SHIFT</kbd> + 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
|
## 2.5.1
|
||||||
|
|
||||||
|
|||||||
@@ -132,14 +132,14 @@ bool shouldSendHelixChat()
|
|||||||
{
|
{
|
||||||
switch (getSettings()->chatSendProtocol)
|
switch (getSettings()->chatSendProtocol)
|
||||||
{
|
{
|
||||||
|
case ChatSendProtocol::Default:
|
||||||
case ChatSendProtocol::Helix:
|
case ChatSendProtocol::Helix:
|
||||||
return true;
|
return true;
|
||||||
case ChatSendProtocol::Default:
|
|
||||||
case ChatSendProtocol::IRC:
|
case ChatSendProtocol::IRC:
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
assert(false && "Invalid chat protocol value");
|
assert(false && "Invalid chat protocol value");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include <magic_enum/magic_enum.hpp>
|
#include <magic_enum/magic_enum.hpp>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
|
#include <QStringBuilder>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -3015,8 +3016,13 @@ void Helix::sendChatMessage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto obj = result.parseJson();
|
const auto obj = result.parseJson();
|
||||||
auto message =
|
auto message = obj["message"].toString();
|
||||||
obj["message"].toString(u"Twitch internal server error"_s);
|
|
||||||
|
if (message.isEmpty())
|
||||||
|
{
|
||||||
|
message = u"Twitch internal server error (" %
|
||||||
|
result.formatError() % ')';
|
||||||
|
}
|
||||||
|
|
||||||
switch (*result.status())
|
switch (*result.status())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user