Skip to content
Snippets Groups Projects
Commit 765bf876 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Workaround synapse bug #4898

Ignore type_error while parsing timestamp of read receipts, because
Synapse sends out data for them, when using workers.
parent 5422d281
No related branches found
No related tags found
No related merge requests found
......@@ -68,8 +68,17 @@ from_json(const json &obj, Ephemeral &ephemeral)
auto event_id = it.key();
auto users = it.value().at("m.read");
for (auto uit = users.begin(); uit != users.end(); ++uit)
user_times.emplace(uit.key(), uit.value().at("ts"));
for (auto uit = users.begin(); uit != users.end(); ++uit) {
uint64_t ts = 0;
try {
ts = uit.value().at("ts");
} catch (json::type_error &) {
std::cerr
<< "mtxclient: Workaround synapse bug #4898, "
"ignoring timestamp for m.receipt event\n";
}
user_times.emplace(uit.key(), ts);
}
receipts.emplace(event_id, user_times);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment