From 23f1ec9ac2ca4e7a5401d483d200a7b5c201a3c1 Mon Sep 17 00:00:00 2001 From: fourtf Date: Tue, 13 Aug 2019 13:00:16 +0200 Subject: [PATCH] Fixed using non existant 2x and 3x versions of ffz emotes and badges --- src/messages/Image.cpp | 2 +- src/messages/ImageSet.cpp | 6 ++++-- src/providers/ffz/FfzEmotes.cpp | 7 +++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/messages/Image.cpp b/src/messages/Image.cpp index 7d397be29..8be4bd930 100644 --- a/src/messages/Image.cpp +++ b/src/messages/Image.cpp @@ -213,7 +213,7 @@ ImagePtr Image::fromUrl(const Url &url, qreal scale) } else { - // Warn("same image loaded multiple times: {}", url.string); + qDebug() << "same image loaded multiple times:" << url.string; } return shared; diff --git a/src/messages/ImageSet.cpp b/src/messages/ImageSet.cpp index 629bbcc9c..222f12203 100644 --- a/src/messages/ImageSet.cpp +++ b/src/messages/ImageSet.cpp @@ -21,8 +21,10 @@ ImageSet::ImageSet(const ImagePtr &image1, const ImagePtr &image2, ImageSet::ImageSet(const Url &image1, const Url &image2, const Url &image3) : imageX1_(Image::fromUrl(image1, 1)) - , imageX2_(Image::fromUrl(image2, 0.5)) - , imageX3_(Image::fromUrl(image3, 0.25)) + , imageX2_(image2.string.isEmpty() ? Image::getEmpty() + : Image::fromUrl(image2, 0.5)) + , imageX3_(image3.string.isEmpty() ? Image::getEmpty() + : Image::fromUrl(image3, 0.25)) { } diff --git a/src/providers/ffz/FfzEmotes.cpp b/src/providers/ffz/FfzEmotes.cpp index c43564037..5dc24fe80 100644 --- a/src/providers/ffz/FfzEmotes.cpp +++ b/src/providers/ffz/FfzEmotes.cpp @@ -32,8 +32,11 @@ namespace { //, code, tooltip emoteData.name = name; emoteData.images = - ImageSet{Image::fromUrl(url1x, 1), Image::fromUrl(url2x, 0.5), - Image::fromUrl(url3x, 0.25)}; + ImageSet{Image::fromUrl(url1x, 1), + url2x.string.isEmpty() ? Image::getEmpty() + : Image::fromUrl(url2x, 0.5), + url3x.string.isEmpty() ? Image::getEmpty() + : Image::fromUrl(url3x, 0.25)}; emoteData.tooltip = {tooltip}; } EmotePtr cachedOrMake(Emote &&emote, const EmoteId &id)