mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 17:40:47 +03:00
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.
This commit is contained in:
parent
dfb8f9a160
commit
2a2ef2f2e5
1 changed files with 3 additions and 1 deletions
|
@ -60,7 +60,9 @@ CombinedImagePackModel::data(const QModelIndex &index, int role) const
|
|||
return QStringLiteral(
|
||||
"<img data-mx-emoticon height=32 src=\"%1\" alt=\"%2\" title=\"%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:
|
||||
|
|
Loading…
Reference in a new issue