Don't use formatted body without format

This commit is contained in:
Nicolas Werner 2020-06-20 19:51:57 +02:00
parent 09e9cffcae
commit a9e321e38f

View file

@ -85,8 +85,10 @@ struct EventFormattedBody
template<class T> template<class T>
std::string operator()(const mtx::events::RoomEvent<T> &e) std::string operator()(const mtx::events::RoomEvent<T> &e)
{ {
if constexpr (is_detected<formatted_body_t, T>::value) if constexpr (is_detected<formatted_body_t, T>::value) {
if (e.content.format == "org.matrix.custom.html")
return e.content.formatted_body; return e.content.formatted_body;
}
return ""; return "";
} }
}; };