0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-28 15:53:46 +02:00

ircd:Ⓜ️ Use room::message for proper body in pretty_msgline().

This commit is contained in:
Jason Volk 2022-08-09 17:15:49 -07:00
parent 0e7c12958a
commit 10554d51b5

View file

@ -663,22 +663,27 @@ ircd::m::pretty_msgline(std::ostream &s,
{
case "m.room.message"_:
{
const json::string msgtype
const room::message msg
{
content["msgtype"]
content
};
const json::string body
const auto &type
{
content["body"]
json::get<"msgtype"_>(msg)
};
const auto &body
{
msg.body()
};
if(!text_only)
s << msgtype << ' ';
else if(msgtype != "m.text")
s << type << ' ';
else if(type != "m.text")
break;
s << body;
s << msg.body();
break;
}