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:
@@ -349,6 +349,9 @@ void Image::actuallyLoad()
|
||||
if (!shared)
|
||||
return Failure;
|
||||
|
||||
if (shared->customOnSuccess_)
|
||||
return shared->customOnSuccess_(shared, result);
|
||||
|
||||
auto data = result.getData();
|
||||
|
||||
// const cast since we are only reading from it
|
||||
@@ -393,4 +396,11 @@ bool Image::operator!=(const Image &other) const
|
||||
return !this->operator==(other);
|
||||
}
|
||||
|
||||
ImagePtr Image::setCustomOnSuccess(
|
||||
std::function<Outcome(ImagePtr, NetworkResult)> customOnSuccess)
|
||||
{
|
||||
this->customOnSuccess_ = customOnSuccess;
|
||||
return shared_from_this();
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user