0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

modules/conf: Improve dump to use formatted HTML; improve hook related.

This commit is contained in:
Jason Volk 2018-03-02 23:17:14 -08:00
parent c4d8b17ecb
commit 1736a47068

View file

@ -83,12 +83,14 @@ try
{
char val[512];
std::stringstream ss;
ss << "<pre>";
for(const auto &p : conf::items)
ss << std::setw(32) << std::right << p.first
<< " = " << p.second->get(val)
<< "\n";
<< "<br />";
ss << "</pre>";
notice(m::control, ss.str());
msghtml(m::control, m::me.user_id, ss.str());
}
catch(const std::exception &e)
{
@ -104,9 +106,6 @@ noexcept
at<"content"_>(event)
};
if(unquote(content.get("msgtype")) == "m.notice")
return;
const string_view &body
{
unquote(content.at("body"))
@ -135,21 +134,18 @@ noexcept
const m::hook
_update_conf_hook
{
_update_conf,
{
{ "_site", "vm notify" },
{ "room_id", "!control:zemos.net" },
{ "type", "m.room.message" },
},
_update_conf
{ "content",
{
{ "msgtype", "m.text" }
}}
}
};
static void
_create_conf_room(const m::event &)
{
m::create(conf_room_id, m::me.user_id);
}
const m::hook
_create_conf_hook
{
@ -158,6 +154,8 @@ _create_conf_hook
{ "room_id", "!ircd:zemos.net" },
{ "type", "m.room.create" },
},
_create_conf_room
[](const m::event &)
{
m::create(conf_room_id, m::me.user_id);
}
};