0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-26 02:18:53 +02:00

modules/client/rooms/receipt: Handle all errors; fixes missing event exceptions.

This commit is contained in:
Jason Volk 2018-05-08 19:01:11 -07:00
parent a4b1ab4b0e
commit 369582339a

View file

@ -129,6 +129,7 @@ bool
fresher__m_receipt_m_read(const m::room::id &room_id,
const m::user::id &user_id,
const m::event::id &event_id)
try
{
const m::user::room user_room
{
@ -136,7 +137,7 @@ fresher__m_receipt_m_read(const m::room::id &room_id,
};
bool ret{true};
user_room.get(std::nothrow, "ircd.read", room_id, [&ret, &event_id]
user_room.get("ircd.read", room_id, [&ret, &event_id]
(const m::event &event)
{
const auto &content
@ -170,6 +171,19 @@ fresher__m_receipt_m_read(const m::room::id &room_id,
return ret;
}
catch(const std::exception &e)
{
log::derror
{
m::log, "Freshness of receipt in %s from %s for %s :%s",
string_view{room_id},
string_view{user_id},
string_view{event_id},
e.what()
};
return true;
}
bool
exists__m_receipt_m_read(const m::room::id &room_id,