Don't show spoilers in sidebar or notifications if possible

fixes #1247
This commit is contained in:
Nicolas Werner 2024-05-16 12:53:34 +02:00
parent e7d28b96da
commit 6150979270
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
37 changed files with 2375 additions and 1132 deletions

View file

@ -107,7 +107,8 @@ NotificationsManager::postNotification(const mtx::responses::Notification &notif
QString template_ = getMessageTemplate(notification);
// TODO: decrypt this message if the decryption setting is on in the UserSettings
if (std::holds_alternative<mtx::events::EncryptedEvent<mtx::events::msg::Encrypted>>(
notification.event)) {
notification.event) ||
!template_.contains("%2")) {
postNotif(template_);
return;
}
@ -115,7 +116,7 @@ NotificationsManager::postNotification(const mtx::responses::Notification &notif
if (hasMarkup_) {
if (hasImages_ &&
(mtx::accessors::msg_type(notification.event) == mtx::events::MessageType::Image ||
mtx::accessors::msg_type(notification.event) == mtx::events::MessageType::Image)) {
mtx::accessors::event_type(notification.event) == mtx::events::EventType::Sticker)) {
MxcImageProvider::download(
QString::fromStdString(mtx::accessors::url(notification.event))
.remove(QStringLiteral("mxc://")),