old hashtags are now suffixed with _v1, new hashtags with _v2. hashtags() is an alias for _v1.

This commit is contained in:
tastytea 2018-06-11 01:52:21 +02:00
parent 8be8d24f6c
commit 14e164d7b4
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
2 changed files with 13 additions and 2 deletions

View File

@ -68,7 +68,7 @@ const std::vector<string> Results::hashtags_v1() const
return get_vector("hashtags");
}
const std::vector<Easy::Tag> Results::hashtags() const
const std::vector<Easy::Tag> Results::hashtags_v2() const
{
const Json::Value node = get("hashtags");
if (node.isArray())
@ -84,3 +84,8 @@ const std::vector<Easy::Tag> Results::hashtags() const
ttdebug << "Could not get data: hashstags\n";
return {};
}
const std::vector<string> Results::hashtags() const
{
return hashtags_v1();
}

View File

@ -79,7 +79,13 @@ namespace Mastodon
*
* @since 0.16.0
*/
const std::vector<Tag> hashtags() const;
const std::vector<Tag> hashtags_v2() const;
/*!
* @brief Alias for hashtags_v1
*/
[[deprecated("Will vanish in 1.0.0, use hashtags_v1() instead")]]
const std::vector<string> hashtags() const;
};
}