Fix more warnings and remove dead code

This commit is contained in:
Nicolas Werner 2021-12-28 22:30:12 +01:00
parent 409ff22d80
commit bb290f9fec
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
50 changed files with 276 additions and 695 deletions

View file

@ -185,7 +185,7 @@ EventStore::EventStore(std::string room_id, QObject *)
// FIXME (introduced by balsoft): this doesn't work for encrypted events, but
// allegedly it's hard to fix so I'll leave my first contribution at that
for (auto related_event_id : cache::client()->relatedEvents(room_id_, txn_id)) {
for (const auto &related_event_id : cache::client()->relatedEvents(room_id_, txn_id)) {
if (cache::client()->getEvent(room_id_, related_event_id)) {
auto related_event =
cache::client()->getEvent(room_id_, related_event_id).value();
@ -717,7 +717,8 @@ void
EventStore::enableKeyRequests(bool suppressKeyRequests_)
{
if (!suppressKeyRequests_) {
for (const auto &key : decryptedEvents_.keys())
auto keys = decryptedEvents_.keys();
for (const auto &key : qAsConst(keys))
if (key.room == this->room_id_)
decryptedEvents_.remove(key);
suppressKeyRequests = false;