0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

ircd:Ⓜ️ Improve my(event): check origin, then id, otherwise false.

This commit is contained in:
Jason Volk 2018-03-14 12:27:44 -07:00
parent da5bca588d
commit 68b5d53ae8

View file

@ -372,7 +372,14 @@ ircd::m::pretty_oneline(const event &event)
bool
ircd::m::my(const event &event)
{
return my(event::id(at<"event_id"_>(event)));
const auto &origin(json::get<"origin"_>(event));
const auto &eid(json::get<"event_id"_>(event));
return
origin?
my_host(origin):
eid?
my(event::id(eid)):
false;
}
bool