Refactored opening from toasts

implemented maps and map look up functions
This commit is contained in:
TranRed
2019-04-27 13:47:13 +02:00
committed by pajlada
parent 2be81aa877
commit c20629c165
4 changed files with 85 additions and 27 deletions
+12
View File
@@ -7,10 +7,21 @@ namespace chatterino {
enum class Platform : uint8_t;
enum class ToastReactions {
openInBrowser,
openInPlayer,
openInStreamlink,
dontOpen
};
class Toasts final : public Singleton
{
public:
void sendChannelNotification(const QString &channelName, Platform p);
static QString findStringFromReaction(const ToastReactions &reaction);
static ToastReactions findReactionFromString(const QString &string);
static std::map<ToastReactions, QString> reactionToString;
static std::map<QString, ToastReactions> stringToReaction;
static bool isEnabled();
@@ -18,6 +29,7 @@ private:
#ifdef Q_OS_WIN
void sendWindowsNotification(const QString &channelName, Platform p);
#endif
static void fetchChannelAvatar(
const QString channelName,
std::function<void(QString)> successCallback);