0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 23:40:57 +01:00

modules/m_event: Calculate unsigned.age relative to origin_server_ts.

This commit is contained in:
Jason Volk 2019-03-25 17:56:11 -07:00
parent a06816b66a
commit 3018062345

View file

@ -540,10 +540,10 @@ ircd::m::append(json::stack::object &object,
{ {
unsigned_, "age", json::value unsigned_, "age", json::value
{ {
has_event_idx && opts.age != std::numeric_limits<long>::min()?
long(vm::sequence::retired - *opts.event_idx):
opts.age != std::numeric_limits<long>::min()? opts.age != std::numeric_limits<long>::min()?
opts.age: opts.age:
json::get<"origin_server_ts"_>(event)?
ircd::time<milliseconds>() - json::get<"origin_server_ts"_>(event):
0L 0L
} }
}; };