diff options
author | fiaxh <git@mx.ax.lt> | 2017-10-29 15:15:28 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-10-31 15:41:45 +0100 |
commit | 0102abeec1d2055b19dccbb7edc7f06e527642b1 (patch) | |
tree | 4018e82224c19142c4a7a6eced67d9c2550b2dd8 /main/src/ui/notifications.vala | |
parent | b9df78e4494879752e9e68dcc5d54e03fffe9467 (diff) | |
download | dino-0102abeec1d2055b19dccbb7edc7f06e527642b1.tar.gz dino-0102abeec1d2055b19dccbb7edc7f06e527642b1.zip |
Fix warnings
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)); |