0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

modules/m_event: Tweak age calculation relation.

This commit is contained in:
Jason Volk 2019-04-19 16:25:14 -07:00
parent 65e58a1787
commit 8299fd695b

View file

@ -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)) + 1:
((*opts.room_depth + 1) - json::get<"depth"_>(event)) + 100:
!opts.room_depth && json::get<"origin_server_ts"_>(event)?
ircd::time<milliseconds>() - json::get<"origin_server_ts"_>(event):
1L
json::undefined_number
}
};