mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
feat: send messages over Helix by default (#5607)
This commit is contained in:
parent
d0bcf35fdc
commit
ef4be6cdac
|
@ -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 (<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
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <magic_enum/magic_enum.hpp>
|
||||
#include <QJsonDocument>
|
||||
#include <QStringBuilder>
|
||||
|
||||
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())
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue