Skip to content
Snippets Groups Projects
Verified Commit 1c277e9a authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Fix parsing of encrypted edits

parent 0411d176
Branches
Tags
No related merge requests found
Pipeline #1369 passed
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#include "mtx/events/encrypted.hpp"
#include "mtx/events/unknown.hpp" #include "mtx/events/unknown.hpp"
namespace mtx::events { namespace mtx::events {
...@@ -33,7 +34,8 @@ template<class Content> ...@@ -33,7 +34,8 @@ template<class Content>
[[gnu::used, llvm::used]] void [[gnu::used, llvm::used]] void
from_json(const json &obj, Event<Content> &event) from_json(const json &obj, Event<Content> &event)
{ {
if (obj.at("content").contains("m.new_content")) { if (!std::is_same_v<Content, mtx::events::msg::Encrypted> &&
obj.at("content").contains("m.new_content")) {
auto new_content = obj.at("content").at("m.new_content"); auto new_content = obj.at("content").at("m.new_content");
if (obj.at("content").contains("m.relates_to")) if (obj.at("content").contains("m.relates_to"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment