feat(notifications): show user avatar when sending live notification on Linux (#5971)

This commit is contained in:
Arne
2025-02-22 15:08:43 +01:00
committed by GitHub
parent 96415b660b
commit f540be3446
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -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)
+12
View File
@@ -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);
}