From e06e574206990c5d0a57d526214f9bf482120412 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Thu, 9 Mar 2023 23:28:10 -0500 Subject: add user avatars to notifications --- src/notifications/notifications.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/notifications/notifications.cpp') diff --git a/src/notifications/notifications.cpp b/src/notifications/notifications.cpp index db06651..78ba53c 100644 --- a/src/notifications/notifications.cpp +++ b/src/notifications/notifications.cpp @@ -110,7 +110,10 @@ void Notifications::NotifyMessageDM(const Message &message) { default_action += std::to_string(message.ChannelID); const auto title = message.Author.Username; const auto body = message.Content; - m_notifier.Notify(title, body, default_action); + + Abaddon::Get().GetImageManager().GetCache().GetFileFromURL(message.Author.GetAvatarURL("png", "64"), [=](const std::string &path) { + m_notifier.Notify(title, body, default_action, path); + }); } void Notifications::NotifyMessageGuild(const Message &message) { @@ -131,7 +134,9 @@ void Notifications::NotifyMessageGuild(const Message &message) { } } const auto body = message.Content; - m_notifier.Notify(title, body, default_action); + Abaddon::Get().GetImageManager().GetCache().GetFileFromURL(message.Author.GetAvatarURL("png", "64"), [=](const std::string &path) { + m_notifier.Notify(title, body, default_action, path); + }); } bool Notifications::IsDND() const { -- cgit v1.2.3