Add toggle to disable decrypting notifications
This commit is contained in:
parent
37009906bb
commit
8a4bb32b4a
5 changed files with 44 additions and 6 deletions
|
|
@ -36,18 +36,18 @@ NotificationsManager::getMessageTemplate(const mtx::responses::Notification ¬
|
|||
}
|
||||
|
||||
void
|
||||
NotificationsManager::removeNotifications(const QString &roomId,
|
||||
NotificationsManager::removeNotifications(const QString &roomId_,
|
||||
const std::vector<QString> &eventIds)
|
||||
{
|
||||
std::string room_id = roomId.toStdString();
|
||||
std::string room_id = roomId_.toStdString();
|
||||
|
||||
std::uint64_t markerPos = 0;
|
||||
for (const auto &e : eventIds) {
|
||||
markerPos = std::max(markerPos, cache::getEventIndex(room_id, e.toStdString()).value_or(0));
|
||||
}
|
||||
|
||||
for (const auto &[roomId, eventId] : this->notificationIds) {
|
||||
if (roomId != roomId)
|
||||
for (const auto &[roomId, eventId] : qAsConst(this->notificationIds)) {
|
||||
if (roomId != roomId_)
|
||||
continue;
|
||||
auto idx = cache::getEventIndex(room_id, eventId.toStdString());
|
||||
if (!idx || markerPos >= idx) {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <QImage>
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue