mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
ircd:Ⓜ️ Move the state/send event iov composer into m_room.
This commit is contained in:
parent
3f4a8647af
commit
6947c7e953
4 changed files with 36 additions and 43 deletions
|
@ -3181,7 +3181,7 @@ ircd::m::send(const room &room,
|
|||
|
||||
static mods::import<prototype> function
|
||||
{
|
||||
"client_rooms", "state__iov"
|
||||
"m_room", "state__iov"
|
||||
};
|
||||
|
||||
return function(room, sender, type, state_key, content);
|
||||
|
@ -3219,7 +3219,7 @@ ircd::m::send(const room &room,
|
|||
|
||||
static mods::import<prototype> function
|
||||
{
|
||||
"client_rooms", "send__iov"
|
||||
"m_room", "send__iov"
|
||||
};
|
||||
|
||||
return function(room, sender, type, content);
|
||||
|
|
|
@ -66,19 +66,3 @@ put__send(client &client,
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
extern "C" event::id::buf
|
||||
send__iov(const room &room,
|
||||
const id::user &sender,
|
||||
const string_view &type,
|
||||
const json::iov &content)
|
||||
{
|
||||
json::iov event;
|
||||
const json::iov::push push[]
|
||||
{
|
||||
{ event, { "sender", sender }},
|
||||
{ event, { "type", type }},
|
||||
};
|
||||
|
||||
return commit(room, event, content);
|
||||
}
|
||||
|
|
|
@ -13,13 +13,6 @@
|
|||
using namespace ircd::m;
|
||||
using namespace ircd;
|
||||
|
||||
extern "C" event::id::buf
|
||||
state__iov(const room &room,
|
||||
const id::user &sender,
|
||||
const string_view &type,
|
||||
const string_view &state_key,
|
||||
const json::iov &content);
|
||||
|
||||
static resource::response
|
||||
get__state(client &client,
|
||||
const resource::request &request,
|
||||
|
@ -197,21 +190,3 @@ get__state(client &client,
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
event::id::buf
|
||||
state__iov(const room &room,
|
||||
const id::user &sender,
|
||||
const string_view &type,
|
||||
const string_view &state_key,
|
||||
const json::iov &content)
|
||||
{
|
||||
json::iov event;
|
||||
const json::iov::push push[]
|
||||
{
|
||||
{ event, { "sender", sender }},
|
||||
{ event, { "type", type }},
|
||||
{ event, { "state_key", state_key }},
|
||||
};
|
||||
|
||||
return commit(room, event, content);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,40 @@ IRCD_MODULE
|
|||
"Matrix room library; modular components."
|
||||
};
|
||||
|
||||
extern "C" m::event::id::buf
|
||||
send__iov(const m::room &room,
|
||||
const m::id::user &sender,
|
||||
const string_view &type,
|
||||
const json::iov &content)
|
||||
{
|
||||
json::iov event;
|
||||
const json::iov::push push[]
|
||||
{
|
||||
{ event, { "sender", sender }},
|
||||
{ event, { "type", type }},
|
||||
};
|
||||
|
||||
return commit(room, event, content);
|
||||
}
|
||||
|
||||
extern "C" m::event::id::buf
|
||||
state__iov(const m::room &room,
|
||||
const m::id::user &sender,
|
||||
const string_view &type,
|
||||
const string_view &state_key,
|
||||
const json::iov &content)
|
||||
{
|
||||
json::iov event;
|
||||
const json::iov::push push[]
|
||||
{
|
||||
{ event, { "sender", sender }},
|
||||
{ event, { "type", type }},
|
||||
{ event, { "state_key", state_key }},
|
||||
};
|
||||
|
||||
return commit(room, event, content);
|
||||
}
|
||||
|
||||
extern "C" size_t
|
||||
count_since(const m::room &room,
|
||||
const m::event::idx &a,
|
||||
|
|
Loading…
Reference in a new issue