mirror of
https://github.com/matrix-construct/construct
synced 2024-12-30 17:34:04 +01:00
ircd:Ⓜ️ Move event/append header.
This commit is contained in:
parent
ad7c6980ac
commit
ef1f6f2642
4 changed files with 26 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
// Matrix Construct
|
// Matrix Construct
|
||||||
//
|
//
|
||||||
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
||||||
// Copyright (C) 2016-2018 Jason Volk <jason@zemos.net>
|
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, and/or distribute this software for any
|
// Permission to use, copy, modify, and/or distribute this software for any
|
||||||
// purpose with or without fee is hereby granted, provided that the above
|
// purpose with or without fee is hereby granted, provided that the above
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
// full license for this software is available in the LICENSE file.
|
// full license for this software is available in the LICENSE file.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#define HAVE_IRCD_M_EVENT_APPEND
|
#define HAVE_IRCD_M_APPEND
|
||||||
|
|
||||||
namespace ircd::m
|
namespace ircd::m
|
||||||
{
|
{
|
|
@ -156,7 +156,6 @@ struct ircd::m::event
|
||||||
#include "cached.h"
|
#include "cached.h"
|
||||||
#include "prefetch.h"
|
#include "prefetch.h"
|
||||||
#include "conforms.h"
|
#include "conforms.h"
|
||||||
#include "append.h"
|
|
||||||
#include "pretty.h"
|
#include "pretty.h"
|
||||||
|
|
||||||
inline ircd::m::event::operator
|
inline ircd::m::event::operator
|
||||||
|
|
|
@ -79,6 +79,7 @@ namespace ircd::m
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
#include "fetch.h"
|
#include "fetch.h"
|
||||||
#include "breadcrumb_rooms.h"
|
#include "breadcrumb_rooms.h"
|
||||||
|
#include "append.h"
|
||||||
|
|
||||||
struct ircd::m::init
|
struct ircd::m::init
|
||||||
{
|
{
|
||||||
|
|
|
@ -415,6 +415,29 @@ ircd::m::append(json::stack::object &object,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if(opts.user_id && !visible(event, *opts.user_id))
|
||||||
|
{
|
||||||
|
log::debug
|
||||||
|
{
|
||||||
|
log, "Not sending event '%s' because not visible by '%s'",
|
||||||
|
string_view{event.event_id},
|
||||||
|
string_view{*opts.user_id}
|
||||||
|
};
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!json::get<"state_key"_>(event) && has_event_idx && m::redacted(*opts.event_idx))
|
||||||
|
{
|
||||||
|
log::debug
|
||||||
|
{
|
||||||
|
log, "Not sending event '%s' because redacted.",
|
||||||
|
string_view{event.event_id},
|
||||||
|
};
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(!json::get<"state_key"_>(event) && has_user)
|
if(!json::get<"state_key"_>(event) && has_user)
|
||||||
{
|
{
|
||||||
const m::user::ignores ignores{*opts.user_id};
|
const m::user::ignores ignores{*opts.user_id};
|
||||||
|
|
Loading…
Reference in a new issue