Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Feb 22, 2025

Conversation

4rneee
Copy link
Contributor

@4rneee 4rneee commented Feb 22, 2025

Add avatar images to live notifications in the libnotify implementation.
Fixes #5938

There are two things I am unsure about:

  1. do I need to check for hasAvatarForChannel(channelName) or can I assume this will be true once sendLibnotify is called?
  2. Is g_object_unref(img) the correct way of 'freeing' the buffer? I copied it from here.

Copy link
Contributor

@Nerixyz Nerixyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. do I need to check for hasAvatarForChannel(channelName) or can I assume this will be true once sendLibnotify is called?

You shouldn't need it. gdk_pixbuf_new_from_file should error if the file doesn't exist when it tries to open it.

  1. Is g_object_unref(img) the correct way of 'freeing' the buffer? I copied it from here.

That should be correct. notify_notification_set_image_from_pixbuf stores a reference and increments the refcount, so one unref on our side is needed.

Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me 👍 thank you!

@pajlada pajlada enabled auto-merge (squash) February 22, 2025 13:38
@pajlada pajlada merged commit f540be3 into Chatterino:master Feb 22, 2025
16 checks passed
@4rneee 4rneee deleted the notifications-show-user-avatar branch February 22, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notifications (Toasts) should show the user Avatar
3 participants