0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 23:44:01 +01:00

modules/client/rooms/invite: Move invite definition to lib.

This commit is contained in:
Jason Volk 2019-10-05 15:50:18 -07:00
parent b8439d61a9
commit 1980fd5e73
2 changed files with 9 additions and 26 deletions

View file

@ -60,18 +60,20 @@ ircd::m::invite(const room &room,
ircd::m::event::id::buf
ircd::m::invite(const room &room,
const id::user &target,
const id::user &sender,
const user::id &target,
const user::id &sender,
json::iov &content)
{
using prototype = event::id::buf (const m::room &, const id::user &, const id::user &, json::iov &);
static mods::import<prototype> call
json::iov event;
const json::iov::push push[]
{
"client_rooms", "ircd::m::invite"
{ event, { "type", "m.room.member" }},
{ event, { "sender", sender }},
{ event, { "state_key", target }},
{ content, { "membership", "invite" }},
};
return call(room, target, sender, content);
return commit(room, event, content);
}
ircd::m::event::id::buf

View file

@ -57,25 +57,6 @@ post__invite(ircd::client &client,
};
}
ircd::m::event::id::buf
IRCD_MODULE_EXPORT
ircd::m::invite(const m::room &room,
const m::user::id &target,
const m::user::id &sender,
json::iov &content)
{
json::iov event;
const json::iov::push push[]
{
{ event, { "type", "m.room.member" }},
{ event, { "sender", sender }},
{ event, { "state_key", target }},
{ content, { "membership", "invite" }},
};
return commit(room, event, content);
}
void
ircd::m::on_invite_foreign(const event &event,
vm::eval &eval)