mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Make code compile with hidden friends
This commit is contained in:
parent
b594242358
commit
3c480d47f1
2 changed files with 8 additions and 8 deletions
|
@ -1207,7 +1207,7 @@ Cache::runMigrations()
|
|||
break;
|
||||
|
||||
mtx::events::collections::TimelineEvent te;
|
||||
mtx::events::collections::from_json(j["event"], te);
|
||||
from_json(j["event"], te);
|
||||
oldMessages.events.push_back(te.data);
|
||||
}
|
||||
// messages were stored in reverse order, so we
|
||||
|
@ -2201,7 +2201,7 @@ Cache::getTimelineMessages(lmdb::txn &txn, const std::string &room_id, uint64_t
|
|||
|
||||
mtx::events::collections::TimelineEvent te;
|
||||
try {
|
||||
mtx::events::collections::from_json(nlohmann::json::parse(event), te);
|
||||
from_json(nlohmann::json::parse(event), te);
|
||||
} catch (std::exception &e) {
|
||||
nhlog::db()->error("Failed to parse message from cache {}", e.what());
|
||||
continue;
|
||||
|
@ -2231,7 +2231,7 @@ Cache::getEvent(const std::string &room_id, const std::string &event_id)
|
|||
|
||||
mtx::events::collections::TimelineEvent te;
|
||||
try {
|
||||
mtx::events::collections::from_json(nlohmann::json::parse(event), te);
|
||||
from_json(nlohmann::json::parse(event), te);
|
||||
} catch (std::exception &e) {
|
||||
nhlog::db()->error("Failed to parse message from cache {}", e.what());
|
||||
return std::nullopt;
|
||||
|
@ -3177,7 +3177,7 @@ Cache::firstPendingMessage(const std::string &room_id)
|
|||
|
||||
try {
|
||||
mtx::events::collections::TimelineEvent te;
|
||||
mtx::events::collections::from_json(nlohmann::json::parse(event), te);
|
||||
from_json(nlohmann::json::parse(event), te);
|
||||
|
||||
pendingCursor.close();
|
||||
txn.commit();
|
||||
|
@ -3316,8 +3316,8 @@ Cache::saveTimelineMessages(lmdb::txn &txn,
|
|||
|
||||
mtx::events::collections::TimelineEvent te;
|
||||
try {
|
||||
mtx::events::collections::from_json(
|
||||
nlohmann::json::parse(std::string_view(oldEvent.data(), oldEvent.size())), te);
|
||||
from_json(nlohmann::json::parse(std::string_view(oldEvent.data(), oldEvent.size())),
|
||||
te);
|
||||
// overwrite the content and add redation data
|
||||
std::visit(
|
||||
[redaction](auto &ev) {
|
||||
|
@ -3578,7 +3578,7 @@ Cache::getTimelineMentionsForRoom(lmdb::txn &txn, const std::string &room_id)
|
|||
continue;
|
||||
|
||||
mtx::responses::Notification notification;
|
||||
mtx::responses::from_json(obj, notification);
|
||||
from_json(obj, notification);
|
||||
|
||||
notif.notifications.push_back(notification);
|
||||
}
|
||||
|
|
|
@ -1245,7 +1245,7 @@ decryptEvent(const MegolmSessionIndex &index,
|
|||
body["unsigned"] = event.unsigned_data;
|
||||
|
||||
mtx::events::collections::TimelineEvent te;
|
||||
mtx::events::collections::from_json(body, te);
|
||||
from_json(body, te);
|
||||
|
||||
// relations are unencrypted in content...
|
||||
mtx::accessors::set_relations(te.data, std::move(event.content.relations));
|
||||
|
|
Loading…
Reference in a new issue