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:
parent
b8439d61a9
commit
1980fd5e73
2 changed files with 9 additions and 26 deletions
|
@ -60,18 +60,20 @@ ircd::m::invite(const room &room,
|
||||||
|
|
||||||
ircd::m::event::id::buf
|
ircd::m::event::id::buf
|
||||||
ircd::m::invite(const room &room,
|
ircd::m::invite(const room &room,
|
||||||
const id::user &target,
|
const user::id &target,
|
||||||
const id::user &sender,
|
const user::id &sender,
|
||||||
json::iov &content)
|
json::iov &content)
|
||||||
{
|
{
|
||||||
using prototype = event::id::buf (const m::room &, const id::user &, const id::user &, json::iov &);
|
json::iov event;
|
||||||
|
const json::iov::push push[]
|
||||||
static mods::import<prototype> call
|
|
||||||
{
|
{
|
||||||
"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
|
ircd::m::event::id::buf
|
||||||
|
|
|
@ -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
|
void
|
||||||
ircd::m::on_invite_foreign(const event &event,
|
ircd::m::on_invite_foreign(const event &event,
|
||||||
vm::eval &eval)
|
vm::eval &eval)
|
||||||
|
|
Loading…
Reference in a new issue