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:
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)))
|
||||
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
|
||||
{
|
||||
*data.out, "presence"
|
||||
|
@ -62,7 +75,7 @@ ircd::m::sync::presence_linear(data &data)
|
|||
// sender
|
||||
json::stack::member
|
||||
{
|
||||
*data.out, "sender", unquote(at<"content"_>(event).get("user_id"))
|
||||
*data.out, "sender", sender
|
||||
};
|
||||
|
||||
// type
|
||||
|
|
Loading…
Reference in a new issue