From 183e18dde5c37dfa481f12b51f2bef8a43fbba6b Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 12 Aug 2022 17:53:18 -0700 Subject: [PATCH] modules/m_room_message: Use room::message tuple; rename info hook. --- modules/m_room_message.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/m_room_message.cc b/modules/m_room_message.cc index 62b97b4a9..c63077bb0 100644 --- a/modules/m_room_message.cc +++ b/modules/m_room_message.cc @@ -10,8 +10,8 @@ namespace ircd::m { - static void room_message_notify(const event &, vm::eval &); - extern hookfn room_message_notify_hook; + static void room_message_info(const event &, vm::eval &); + extern hookfn 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