mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix Handling of FFZ CDN URLs with https already appended (#4432)
This commit is contained in:
parent
1dc2bcc445
commit
b9e87dcd2b
|
@ -4,6 +4,7 @@
|
|||
|
||||
- Minor: Delete all but the last 5 crashdumps on application start. (#4392)
|
||||
- Minor: Added `/banid` command that allows banning by user ID. (#4411)
|
||||
- Bugfix: Fixed FrankerFaceZ emotes/badges not loading due to API change. (#4432)
|
||||
- Bugfix: Fixed uploaded AppImage not being able most web requests. (#4400)
|
||||
- Bugfix: Fixed a potential race condition due to using the wrong lock when loading 7TV badges. (#4402)
|
||||
- Dev: Add capability to build Chatterino with Qt6. (#4393)
|
||||
|
|
|
@ -225,6 +225,8 @@ set(SOURCE_FILES
|
|||
providers/ffz/FfzBadges.hpp
|
||||
providers/ffz/FfzEmotes.cpp
|
||||
providers/ffz/FfzEmotes.hpp
|
||||
providers/ffz/FfzUtil.cpp
|
||||
providers/ffz/FfzUtil.hpp
|
||||
|
||||
providers/irc/AbstractIrcServer.cpp
|
||||
providers/irc/AbstractIrcServer.hpp
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "common/NetworkResult.hpp"
|
||||
#include "common/Outcome.hpp"
|
||||
#include "messages/Emote.hpp"
|
||||
#include "providers/ffz/FfzUtil.hpp"
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
|
@ -67,14 +68,12 @@ void FfzBadges::load()
|
|||
auto jsonBadge = jsonBadge_.toObject();
|
||||
auto jsonUrls = jsonBadge.value("urls").toObject();
|
||||
|
||||
auto emote = Emote{
|
||||
EmoteName{},
|
||||
ImageSet{
|
||||
Url{QString("https:") + jsonUrls.value("1").toString()},
|
||||
Url{QString("https:") + jsonUrls.value("2").toString()},
|
||||
Url{QString("https:") +
|
||||
jsonUrls.value("4").toString()}},
|
||||
Tooltip{jsonBadge.value("title").toString()}, Url{}};
|
||||
auto emote =
|
||||
Emote{EmoteName{},
|
||||
ImageSet{parseFfzUrl(jsonUrls.value("1").toString()),
|
||||
parseFfzUrl(jsonUrls.value("2").toString()),
|
||||
parseFfzUrl(jsonUrls.value("4").toString())},
|
||||
Tooltip{jsonBadge.value("title").toString()}, Url{}};
|
||||
|
||||
Badge badge;
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "messages/Emote.hpp"
|
||||
#include "messages/Image.hpp"
|
||||
#include "messages/MessageBuilder.hpp"
|
||||
#include "providers/ffz/FfzUtil.hpp"
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
|
||||
|
@ -26,8 +27,9 @@ namespace {
|
|||
|
||||
assert(emote.isString());
|
||||
|
||||
return {"https:" + emote.toString()};
|
||||
return parseFfzUrl(emote.toString());
|
||||
}
|
||||
|
||||
void fillInEmoteData(const QJsonObject &urls, const EmoteName &name,
|
||||
const QString &tooltip, Emote &emoteData)
|
||||
{
|
||||
|
|
12
src/providers/ffz/FfzUtil.cpp
Normal file
12
src/providers/ffz/FfzUtil.cpp
Normal file
|
@ -0,0 +1,12 @@
|
|||
#include "providers/ffz/FfzUtil.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
Url parseFfzUrl(const QString &ffzUrl)
|
||||
{
|
||||
QUrl asURL(ffzUrl);
|
||||
asURL.setScheme("https");
|
||||
return {asURL.toString()};
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
12
src/providers/ffz/FfzUtil.hpp
Normal file
12
src/providers/ffz/FfzUtil.hpp
Normal file
|
@ -0,0 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include "common/Aliases.hpp"
|
||||
|
||||
#include <QString>
|
||||
#include <QUrl>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
Url parseFfzUrl(const QString &ffzUrl);
|
||||
|
||||
} // namespace chatterino
|
Loading…
Reference in a new issue