Don't try to load emotes from space parents we are not in

This commit is contained in:
Nicolas Werner 2023-03-19 14:04:13 +01:00
parent e114b1adc7
commit fafb9cc4a6
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -4179,8 +4179,15 @@ Cache::getImagePacks(const std::string &room_id, std::optional<bool> stickers)
for (const auto &parent :
getStateEventsWithType<mtx::events::state::space::Parent>(txn, current_room)) {
if (parent.content.canonical && parent.content.via && !parent.content.via->empty())
if (parent.content.canonical && parent.content.via && !parent.content.via->empty()) {
try {
addRoomAndCanonicalParents(parent.state_key);
} catch (const lmdb::error &) {
nhlog::db()->debug("Skipping events from parent community, because we are "
"not joined to it: {}",
parent.state_key);
}
}
}
};