diff --git a/src/easy/entities/card.cpp b/src/easy/entities/card.cpp index fdddb9b..a51af62 100644 --- a/src/easy/entities/card.cpp +++ b/src/easy/entities/card.cpp @@ -46,6 +46,11 @@ const string Card::description() const return get_string("description"); } +const string Card::embed_url() const +{ + return get_string("embed_url"); +} + uint64_t Card::height() const { return get_uint64("height"); @@ -79,17 +84,16 @@ const string Card::title() const Easy::card_type Card::type() const { const string strtype = get_string("type"); - if (strtype.compare("link") == 0) + if (strtype == "link") return card_type::Link; - else if (strtype.compare("photo") == 0) + else if (strtype == "photo") return card_type::Photo; - else if (strtype.compare("video") == 0) + else if (strtype == "video") return card_type::Video; - else if (strtype.compare("rich") == 0) + else if (strtype == "rich") return card_type::Rich; - - ttdebug << "Could not get data: type\n"; - return card_type::Undefined; + else + return card_type::Undefined; } const string Card::url() const diff --git a/src/easy/entities/card.hpp b/src/easy/entities/card.hpp index 536c082..a6a40fe 100644 --- a/src/easy/entities/card.hpp +++ b/src/easy/entities/card.hpp @@ -69,6 +69,15 @@ namespace Easy */ const string description() const; + /*! + * @brief Returns the embed URL. + * + * This is an undocumented attribute and may vanish at any time. + * + * @since 0.106.0 + */ + const string embed_url() const; + /*! * @brief Returns the height of the card *