Skip to content
Snippets Groups Projects
Unverified Commit 67e1bdda authored by NepNep21's avatar NepNep21
Browse files

Remove duplicated code

parent 41464c96
Branches reportContent
No related tags found
No related merge requests found
Pipeline #5586 failed
......@@ -38,6 +38,7 @@ from_json(const json &obj, URLPreview &res)
res.title = obj.at("og:title").get<std::string>();
res.url = obj.at("og:url").get<std::string>();
extractOptionalAttribute(obj, "og:site_name", res.site_name);
extractOptionalAttribute(obj, "og:description", res.description);
extractOptionalAttribute(obj, "og:image:type", res.image.type);
extractOptionalAttribute(obj, "og:image:width", res.image.width);
......@@ -46,10 +47,6 @@ from_json(const json &obj, URLPreview &res)
res.image.size = obj.at("matrix:image:size").get<std::uint64_t>();
res.image.url = obj.at("og:image").get<std::string>();
if (obj.contains("og:description")) {
res.description = obj.at("og:description").get<std::string>();
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment