diff options
author | Dylam De La Torre <DyXel04@gmail.com> | 2021-11-23 05:21:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 04:21:56 +0000 |
commit | a51a54bc5979a2491f152abc47ad54e6b63f27c8 (patch) | |
tree | ce67092b2f6df366033a65a6111e4650866766b2 /discord/emoji.cpp | |
parent | d88079000a79e6bcbe51c5a2868d57b303b5fcb6 (diff) | |
download | abaddon-portaudio-a51a54bc5979a2491f152abc47ad54e6b63f27c8.tar.gz abaddon-portaudio-a51a54bc5979a2491f152abc47ad54e6b63f27c8.zip |
Restructure source and resource files (#46)
importantly, res is now res/res and css is now res/css
Diffstat (limited to 'discord/emoji.cpp')
-rw-r--r-- | discord/emoji.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/discord/emoji.cpp b/discord/emoji.cpp deleted file mode 100644 index 1a97eb8..0000000 --- a/discord/emoji.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "emoji.hpp" - -void from_json(const nlohmann::json &j, EmojiData &m) { - JS_N("id", m.ID); - JS_N("name", m.Name); - JS_O("roles", m.Roles); - JS_O("user", m.Creator); - JS_O("require_colons", m.NeedsColons); - JS_O("managed", m.IsManaged); - JS_O("animated", m.IsAnimated); - JS_O("available", m.IsAvailable); -} - -void to_json(nlohmann::json &j, const EmojiData &m) { - if (m.ID.IsValid()) - j["id"] = m.ID; - else - j["id"] = nullptr; - if (m.Name != "") - j["name"] = m.Name; - else - j["name"] = nullptr; - JS_IF("roles", m.Roles); - JS_IF("user", m.Creator); - JS_IF("require_colons", m.NeedsColons); - JS_IF("managed", m.IsManaged); - JS_IF("animated", m.IsAnimated); - JS_IF("available", m.IsAvailable); -} - -std::string EmojiData::GetURL(const char *ext, const char *size) const { - if (size != nullptr) - return "https://cdn.discordapp.com/emojis/" + std::to_string(ID) + "." + ext + "?size=" + size; - else - return "https://cdn.discordapp.com/emojis/" + std::to_string(ID) + "." + ext; -} - -std::string EmojiData::URLFromID(const std::string &emoji_id, const char *ext, const char *size) { - if (size != nullptr) - return "https://cdn.discordapp.com/emojis/" + emoji_id + "." + ext + "?size=" + size; - else - return "https://cdn.discordapp.com/emojis/" + emoji_id + "." + ext; -} - -std::string EmojiData::URLFromID(Snowflake emoji_id, const char *ext, const char *size) { - return URLFromID(std::to_string(emoji_id), ext, size); -} - -std::string EmojiData::URLFromID(const Glib::ustring &emoji_id, const char *ext, const char *size) { - return URLFromID(emoji_id.raw(), ext, size); -} |