From f540be3446605391ebf58b1e1c2b44a5137f69ff Mon Sep 17 00:00:00 2001 From: Arne <78976058+4rneee@users.noreply.github.com> Date: Sat, 22 Feb 2025 15:08:43 +0100 Subject: [PATCH] feat(notifications): show user avatar when sending live notification on Linux (#5971) --- CHANGELOG.md | 2 +- src/singletons/Toasts.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0062e10e..c264e761 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ - Minor: When (re-)connecting, visible channels are now joined first. (#5850) - Minor: Added the ability to filter on messages by the author's user ID (example: `author.user_id == "22484632"`). (#5862) - Minor: Improved error messaging of the `/clip` command. (#5879) -- Minor: Added Linux support for Live Notifications toasts. (#5881) +- Minor: Added Linux support for Live Notifications toasts. (#5881, #5971) - Minor: Messages can now be deleted from the context menu in a channel. (#5956) - Bugfix: Fixed a potential way to escape the Lua Plugin sandbox. (#5846) - Bugfix: Fixed a crash relating to Lua HTTP. (#5800) diff --git a/src/singletons/Toasts.cpp b/src/singletons/Toasts.cpp index 2c51e2a8..5f67df44 100644 --- a/src/singletons/Toasts.cpp +++ b/src/singletons/Toasts.cpp @@ -310,6 +310,18 @@ void Toasts::sendLibnotify(const QString &channelName, NotifyNotification *notif = notify_notification_new( str.toUtf8().constData(), channelTitle.toUtf8().constData(), nullptr); + GdkPixbuf *img = gdk_pixbuf_new_from_file( + avatarFilePath(channelName).toUtf8().constData(), nullptr); + if (img == nullptr) + { + qWarning(chatterinoNotification) << "Failed to load user avatar image"; + } + else + { + notify_notification_set_image_from_pixbuf(notif, img); + g_object_unref(img); + } + notify_notification_show(notif, nullptr); g_object_unref(notif); }