summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-06-20 19:51:57 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-06-26 13:36:21 +0200
commita9e321e38fba663f792849b677aa6c815647cb76 (patch)
treefc48403ea7672edd0d37a08378b63cd8f5560678
parentMerge pull request #228 from felixonmars/patch-1 (diff)
downloadnheko-a9e321e38fba663f792849b677aa6c815647cb76.tar.xz
Don't use formatted body without format
-rw-r--r--src/EventAccessors.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/EventAccessors.cpp b/src/EventAccessors.cpp
index a2d8adbb..7071819b 100644
--- a/src/EventAccessors.cpp
+++ b/src/EventAccessors.cpp
@@ -85,8 +85,10 @@ struct EventFormattedBody
         template<class T>
         std::string operator()(const mtx::events::RoomEvent<T> &e)
         {
-                if constexpr (is_detected<formatted_body_t, T>::value)
-                        return e.content.formatted_body;
+                if constexpr (is_detected<formatted_body_t, T>::value) {
+                        if (e.content.format == "org.matrix.custom.html")
+                                return e.content.formatted_body;
+                }
                 return "";
         }
 };