diff options
Diffstat (limited to 'main/src/ui/notifications.vala')
-rw-r--r-- | main/src/ui/notifications.vala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/main/src/ui/notifications.vala b/main/src/ui/notifications.vala index cfbec8dc..464f5b0d 100644 --- a/main/src/ui/notifications.vala +++ b/main/src/ui/notifications.vala @@ -92,7 +92,9 @@ public class Notifications : Object { } notifications[conversation].set_title(display_name); notifications[conversation].set_body(text); - notifications[conversation].set_icon(get_pixbuf_icon((new AvatarGenerator(40, 40)).draw_conversation(stream_interactor, conversation))); + try { + notifications[conversation].set_icon(get_pixbuf_icon((new AvatarGenerator(40, 40)).draw_conversation(stream_interactor, conversation))); + } catch (Error e) { } window.get_application().send_notification(conversation.id.to_string(), notifications[conversation]); active_notification_ids.add(conversation.id.to_string()); window.urgency_hint = true; @@ -102,7 +104,9 @@ public class Notifications : Object { private void on_received_subscription_request(Jid jid, Account account) { Notification notification = new Notification(_("Subscription request")); notification.set_body(jid.bare_jid.to_string()); - notification.set_icon(get_pixbuf_icon((new AvatarGenerator(40, 40)).draw_jid(stream_interactor, jid, account))); + try { + notification.set_icon(get_pixbuf_icon((new AvatarGenerator(40, 40)).draw_jid(stream_interactor, jid, account))); + } catch (Error e) { } Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(jid, account, Conversation.Type.CHAT); notification.add_button_with_target_value(_("Accept"), "app.accept-subscription", conversation.id); notification.add_button_with_target_value(_("Deny"), "app.deny-subscription", conversation.id); @@ -119,7 +123,7 @@ public class Notifications : Object { return true; } - private Icon get_pixbuf_icon(Gdk.Pixbuf avatar) { + private Icon get_pixbuf_icon(Gdk.Pixbuf avatar) throws Error { uint8[] buffer; avatar.save_to_buffer(out buffer, "png"); return new BytesIcon(new Bytes(buffer)); |