Load mod badge information from the FFZ API instead of assuming the URL.
This lets us load all sizes of the emote if they are available. Channel with all versions of the mod badge: https://api.frankerfacez.com/v1/room/pajlada Channel with only one version of the mod badge: https://api.frankerfacez.com/v1/room/apa420 Channel with no mod badge: https://api.frankerfacez.com/v1/room/forsen
This commit is contained in:
@@ -13,7 +13,9 @@
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
|
||||
#include "common/Aliases.hpp"
|
||||
#include "common/NetworkResult.hpp"
|
||||
#include "common/NullablePtr.hpp"
|
||||
#include "common/Outcome.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
namespace detail {
|
||||
@@ -66,13 +68,18 @@ public:
|
||||
bool operator==(const Image &image) const;
|
||||
bool operator!=(const Image &image) const;
|
||||
|
||||
ImagePtr setCustomOnSuccess(
|
||||
std::function<Outcome(ImagePtr, NetworkResult)> onSuccess);
|
||||
|
||||
private:
|
||||
Image();
|
||||
Image(const Url &url, qreal scale);
|
||||
Image(qreal scale);
|
||||
|
||||
public:
|
||||
void setPixmap(const QPixmap &pixmap);
|
||||
|
||||
private:
|
||||
void actuallyLoad();
|
||||
|
||||
Url url_{};
|
||||
@@ -81,5 +88,6 @@ private:
|
||||
bool shouldLoad_{false};
|
||||
std::unique_ptr<detail::Frames> frames_{};
|
||||
QObject object_{};
|
||||
std::function<Outcome(ImagePtr, NetworkResult)> customOnSuccess_{};
|
||||
};
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user