summary refs log tree commit diff
path: root/src/notifications
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-03-02 19:42:56 -0500
committerNicolas Werner <nicolas.werner@hotmail.de>2021-03-17 19:18:07 +0100
commit5da6ab0aec1cc397aed9f54e3d3525520212447f (patch)
tree53a9b1b5c2f595975b30cb0d48c6625461f692b8 /src/notifications
parentBlock notifications until the image has been downloaded (diff)
downloadnheko-5da6ab0aec1cc397aed9f54e3d3525520212447f.tar.xz
make lint
Diffstat (limited to 'src/notifications')
-rw-r--r--src/notifications/ManagerLinux.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/notifications/ManagerLinux.cpp b/src/notifications/ManagerLinux.cpp

index 0cf61d5c..5581252d 100644 --- a/src/notifications/ManagerLinux.cpp +++ b/src/notifications/ManagerLinux.cpp
@@ -214,19 +214,18 @@ NotificationsManager::formatNotification(const mtx::responses::Notification &not ": "); if (hasMarkup_) { - if (hasImages_ && - mtx::accessors::msg_type(notification.event) == mtx::events::MessageType::Image) - { - QString imgPath = cacheImage(notification.event); - if (imgPath.isNull()) - return mtx::accessors::formattedBodyWithFallback(notification.event).prepend(messageLeadIn); - else - return QString( - "<img src=\"file:///" + imgPath + - "\" alt=\"" + - mtx::accessors::formattedBodyWithFallback(notification.event) + - "\">") - .prepend(messageLeadIn); + if (hasImages_ && mtx::accessors::msg_type(notification.event) == + mtx::events::MessageType::Image) { + QString imgPath = cacheImage(notification.event); + if (imgPath.isNull()) + return mtx::accessors::formattedBodyWithFallback(notification.event) + .prepend(messageLeadIn); + else + return QString("<img src=\"file:///" + imgPath + "\" alt=\"" + + mtx::accessors::formattedBodyWithFallback( + notification.event) + + "\">") + .prepend(messageLeadIn); } return mtx::accessors::formattedBodyWithFallback(notification.event)