Rewrote enums for consistency
This commit is contained in:
parent
3acd8536d8
commit
f298de7cff
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required (VERSION 3.7)
|
||||
project (mastodon-cpp
|
||||
VERSION 0.7.21
|
||||
VERSION 0.7.22
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
|
|
|
@ -135,16 +135,16 @@ const Easy::attachment_type Attachment::type() const
|
|||
{
|
||||
const string strtype = get_string("type");
|
||||
if (strtype.compare("image") == 0)
|
||||
return attachment_type::image;
|
||||
return attachment_type::Image;
|
||||
else if (strtype.compare("video") == 0)
|
||||
return attachment_type::video;
|
||||
return attachment_type::Video;
|
||||
else if (strtype.compare("gifv") == 0)
|
||||
return attachment_type::gifv;
|
||||
return attachment_type::Gifv;
|
||||
else if (strtype.compare("unknown") == 0)
|
||||
return attachment_type::unknown;
|
||||
return attachment_type::Unknown;
|
||||
|
||||
ttdebug << "Could not get data: type\n";
|
||||
return attachment_type::unknown;
|
||||
return attachment_type::Undefined;
|
||||
}
|
||||
|
||||
const string Attachment::url() const
|
||||
|
|
|
@ -77,16 +77,16 @@ const Easy::card_type Card::type() const
|
|||
{
|
||||
const string strtype = get_string("type");
|
||||
if (strtype.compare("link") == 0)
|
||||
return card_type::link;
|
||||
return card_type::Link;
|
||||
else if (strtype.compare("photo") == 0)
|
||||
return card_type::photo;
|
||||
return card_type::Photo;
|
||||
else if (strtype.compare("video") == 0)
|
||||
return card_type::video;
|
||||
return card_type::Video;
|
||||
else if (strtype.compare("rich") == 0)
|
||||
return card_type::rich;
|
||||
return card_type::Rich;
|
||||
|
||||
ttdebug << "Could not get data: type\n";
|
||||
return card_type::unknown;
|
||||
return card_type::Undefined;
|
||||
}
|
||||
|
||||
const string Card::url() const
|
||||
|
|
|
@ -56,9 +56,6 @@ public:
|
|||
|
||||
/*!
|
||||
* @brief Describes visibility of toots.
|
||||
*
|
||||
* The names begin with a capital letter because some of them
|
||||
* are reserved keywords when written in all-lowercase.
|
||||
*/
|
||||
enum class visibility_type
|
||||
{
|
||||
|
@ -74,10 +71,11 @@ public:
|
|||
*/
|
||||
enum class attachment_type
|
||||
{
|
||||
image,
|
||||
video,
|
||||
gifv,
|
||||
unknown
|
||||
Image,
|
||||
Video,
|
||||
Gifv,
|
||||
Unknown,
|
||||
Undefined
|
||||
};
|
||||
|
||||
/*!
|
||||
|
@ -85,11 +83,11 @@ public:
|
|||
*/
|
||||
enum class card_type
|
||||
{
|
||||
link,
|
||||
photo,
|
||||
video,
|
||||
rich,
|
||||
unknown
|
||||
Link,
|
||||
Photo,
|
||||
Video,
|
||||
Rich,
|
||||
Undefined
|
||||
};
|
||||
|
||||
/*!
|
||||
|
@ -97,11 +95,11 @@ public:
|
|||
*/
|
||||
enum class notification_type
|
||||
{
|
||||
mention,
|
||||
reblog,
|
||||
favourite,
|
||||
follow,
|
||||
unknown
|
||||
Mention,
|
||||
Reblog,
|
||||
Favourite,
|
||||
Follow,
|
||||
Undefined
|
||||
};
|
||||
|
||||
typedef std::pair<event_type, string> stream_event;
|
||||
|
|
|
@ -66,13 +66,13 @@ const Easy::notification_type Notification::type() const
|
|||
{
|
||||
const string strtype = get_string("type");
|
||||
if (strtype.compare("mention") == 0)
|
||||
return notification_type::mention;
|
||||
return notification_type::Mention;
|
||||
else if (strtype.compare("reblog") == 0)
|
||||
return notification_type::reblog;
|
||||
return notification_type::Reblog;
|
||||
else if (strtype.compare("favourite") == 0)
|
||||
return notification_type::favourite;
|
||||
return notification_type::Favourite;
|
||||
else if (strtype.compare("follow") == 0)
|
||||
return notification_type::follow;
|
||||
return notification_type::Follow;
|
||||
|
||||
return notification_type::unknown;
|
||||
return notification_type::Undefined;
|
||||
}
|
||||
|
|
Reference in New Issue