mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
modules/client/sync/presence: Add mitsein condition to linear handler.
This commit is contained in:
parent
5db50b0b0c
commit
13054243a5
1 changed files with 14 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue