From 2a2ef2f2e5dbce97da9b0b73f9128991003fadcf Mon Sep 17 00:00:00 2001 From: Ivan Pavluk Date: Sun, 13 Feb 2022 04:46:15 +0700 Subject: [PATCH] use shortcode as a fallback for custom emote title Some clients (e.g. FluffyChat) don't have a UI for specifying the emote title, and instead use the shortcode as the title. This sets the title accordingly even if the emote was added through such a client and only has a shortcode. --- src/CombinedImagePackModel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CombinedImagePackModel.cpp b/src/CombinedImagePackModel.cpp index 27b96b92..58400fb1 100644 --- a/src/CombinedImagePackModel.cpp +++ b/src/CombinedImagePackModel.cpp @@ -60,7 +60,9 @@ CombinedImagePackModel::data(const QModelIndex &index, int role) const return QStringLiteral( "\"%2\"") .arg(QString::fromStdString(images[index.row()].image.url).toHtmlEscaped(), - QString::fromStdString(images[index.row()].image.body)); + images[index.row()].image.body.length() > 0 + ? QString::fromStdString(images[index.row()].image.body) + : images[index.row()].shortcode); case Roles::Url: return QString::fromStdString(images[index.row()].image.url); case CompletionModel::SearchRole: