Fix empty widgets still being shown

This commit is contained in:
Nicolas Werner 2022-08-30 22:05:33 +02:00
parent 57f505c486
commit 130e1b43fb
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -2795,6 +2795,10 @@ TimelineModel::widgetLinks() const
list.reserve(evs.size()); list.reserve(evs.size());
for (const auto &p : evs) { for (const auto &p : evs) {
auto url = QString::fromStdString(p.content.url); auto url = QString::fromStdString(p.content.url);
if (url.isEmpty())
continue;
for (const auto &[k, v] : p.content.data) for (const auto &[k, v] : p.content.data)
url.replace("$" + QString::fromStdString(k), url.replace("$" + QString::fromStdString(k),
QUrl::toPercentEncoding(QString::fromStdString(v))); QUrl::toPercentEncoding(QString::fromStdString(v)));