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

modules/client/sync/presence: Add mitsein condition to linear handler.

This commit is contained in:
Jason Volk 2020-03-31 12:51:18 -07:00
parent 5db50b0b0c
commit 13054243a5

View file

@ -44,6 +44,19 @@ ircd::m::sync::presence_linear(data &data)
if(!my_host(json::get<"origin"_>(event))) if(!my_host(json::get<"origin"_>(event)))
return false; return false;
const json::string &sender
{
at<"content"_>(event).get("user_id")
};
const m::user::mitsein mitsein
{
data.user
};
if(!mitsein.has(m::user::id(sender), "join"))
return false;
json::stack::object presence json::stack::object presence
{ {
*data.out, "presence" *data.out, "presence"
@ -62,7 +75,7 @@ ircd::m::sync::presence_linear(data &data)
// sender // sender
json::stack::member json::stack::member
{ {
*data.out, "sender", unquote(at<"content"_>(event).get("user_id")) *data.out, "sender", sender
}; };
// type // type