mirror of
https://github.com/matrix-construct/construct
synced 2024-11-13 21:41:06 +01:00
modules/client/rooms/receipt: Handle all errors; fixes missing event exceptions.
This commit is contained in:
parent
a4b1ab4b0e
commit
369582339a
1 changed files with 15 additions and 1 deletions
|
@ -129,6 +129,7 @@ bool
|
||||||
fresher__m_receipt_m_read(const m::room::id &room_id,
|
fresher__m_receipt_m_read(const m::room::id &room_id,
|
||||||
const m::user::id &user_id,
|
const m::user::id &user_id,
|
||||||
const m::event::id &event_id)
|
const m::event::id &event_id)
|
||||||
|
try
|
||||||
{
|
{
|
||||||
const m::user::room user_room
|
const m::user::room user_room
|
||||||
{
|
{
|
||||||
|
@ -136,7 +137,7 @@ fresher__m_receipt_m_read(const m::room::id &room_id,
|
||||||
};
|
};
|
||||||
|
|
||||||
bool ret{true};
|
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 m::event &event)
|
||||||
{
|
{
|
||||||
const auto &content
|
const auto &content
|
||||||
|
@ -170,6 +171,19 @@ fresher__m_receipt_m_read(const m::room::id &room_id,
|
||||||
|
|
||||||
return ret;
|
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
|
bool
|
||||||
exists__m_receipt_m_read(const m::room::id &room_id,
|
exists__m_receipt_m_read(const m::room::id &room_id,
|
||||||
|
|
Loading…
Reference in a new issue