mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
modules/m_event: Prevent mixing calculation types; add one to the depth result.
This commit is contained in:
parent
61a091d90e
commit
34c38b854f
1 changed files with 3 additions and 3 deletions
|
@ -543,10 +543,10 @@ ircd::m::append(json::stack::object &object,
|
|||
opts.age != std::numeric_limits<long>::min()?
|
||||
opts.age:
|
||||
json::get<"depth"_>(event) >= 0 && opts.room_depth && *opts.room_depth >= 0L?
|
||||
*opts.room_depth - json::get<"depth"_>(event):
|
||||
json::get<"origin_server_ts"_>(event)?
|
||||
(*opts.room_depth - json::get<"depth"_>(event)) + 1:
|
||||
!opts.room_depth && json::get<"origin_server_ts"_>(event)?
|
||||
ircd::time<milliseconds>() - json::get<"origin_server_ts"_>(event):
|
||||
0L
|
||||
1L
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue