0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd:Ⓜ️ Move the state/send event iov composer into m_room.

This commit is contained in:
Jason Volk 2019-02-04 13:57:56 -08:00
parent 3f4a8647af
commit 6947c7e953
4 changed files with 36 additions and 43 deletions

View file

@ -3181,7 +3181,7 @@ ircd::m::send(const room &room,
static mods::import<prototype> function static mods::import<prototype> function
{ {
"client_rooms", "state__iov" "m_room", "state__iov"
}; };
return function(room, sender, type, state_key, content); return function(room, sender, type, state_key, content);
@ -3219,7 +3219,7 @@ ircd::m::send(const room &room,
static mods::import<prototype> function static mods::import<prototype> function
{ {
"client_rooms", "send__iov" "m_room", "send__iov"
}; };
return function(room, sender, type, content); return function(room, sender, type, content);

View file

@ -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);
}

View file

@ -13,13 +13,6 @@
using namespace ircd::m; using namespace ircd::m;
using namespace ircd; 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 static resource::response
get__state(client &client, get__state(client &client,
const resource::request &request, 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);
}

View file

@ -16,6 +16,40 @@ IRCD_MODULE
"Matrix room library; modular components." "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 extern "C" size_t
count_since(const m::room &room, count_since(const m::room &room,
const m::event::idx &a, const m::event::idx &a,