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

modules/m_room_message: Use room::message tuple; rename info hook.

This commit is contained in:
Jason Volk 2022-08-12 17:53:18 -07:00
parent 387b60cb15
commit 183e18dde5

View file

@ -10,8 +10,8 @@
namespace ircd::m
{
static void room_message_notify(const event &, vm::eval &);
extern hookfn<vm::eval &> room_message_notify_hook;
static void room_message_info(const event &, vm::eval &);
extern hookfn<vm::eval &> room_message_info_hook;
extern log::log room_message_log;
}
@ -27,10 +27,10 @@ ircd::m::room_message_log
"m.message"
};
decltype(ircd::m::room_message_notify_hook)
ircd::m::room_message_notify_hook
decltype(ircd::m::room_message_info_hook)
ircd::m::room_message_info_hook
{
room_message_notify,
room_message_info,
{
{ "_site", "vm.notify" },
{ "type", "m.room.message" },
@ -38,22 +38,22 @@ ircd::m::room_message_notify_hook
};
void
ircd::m::room_message_notify(const event &event,
vm::eval &eval)
ircd::m::room_message_info(const event &event,
vm::eval &eval)
{
const auto &content
const m::room::message msg
{
json::get<"content"_>(event)
};
const json::string &body
const auto &body
{
content.get("body")
msg.body()
};
const json::string &msgtype
const auto &msgtype
{
content.get("msgtype")
json::get<"msgtype"_>(msg)
};
log::info