aboutsummaryrefslogtreecommitdiff
path: root/src/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/event.c')
-rw-r--r--src/event.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/event.c b/src/event.c
index 4540567..9bbc064 100644
--- a/src/event.c
+++ b/src/event.c
@@ -33,8 +33,12 @@
33 33
34static void 34static void
35_close_notification(NotifyNotification* notification, 35_close_notification(NotifyNotification* notification,
36 UNUSED gpointer user_data) 36 gpointer user_data)
37{ 37{
38 MESSENGER_Application *app = (MESSENGER_Application*) user_data;
39
40 app->notifications = g_list_remove(app->notifications, notification);
41
38 notify_notification_clear_actions(notification); 42 notify_notification_clear_actions(notification);
39 notify_notification_clear_hints(notification); 43 notify_notification_clear_hints(notification);
40 44
@@ -42,7 +46,7 @@ _close_notification(NotifyNotification* notification,
42} 46}
43 47
44static void 48static void
45_show_notification(UNUSED MESSENGER_Application *app, 49_show_notification(MESSENGER_Application *app,
46 UNUSED struct GNUNET_CHAT_Context *context, 50 UNUSED struct GNUNET_CHAT_Context *context,
47 const struct GNUNET_CHAT_Contact *contact, 51 const struct GNUNET_CHAT_Contact *contact,
48 const gchar *text, 52 const gchar *text,
@@ -54,6 +58,11 @@ _show_notification(UNUSED MESSENGER_Application *app,
54 sender? sender : "(unknown)", text, icon 58 sender? sender : "(unknown)", text, icon
55 ); 59 );
56 60
61 if (!notification)
62 return;
63
64 app->notifications = g_list_append(app->notifications, notification);
65
57 if (0 == g_strcmp0(icon, "avatar-default-symbolic")) 66 if (0 == g_strcmp0(icon, "avatar-default-symbolic"))
58 notify_notification_set_category(notification, "presence.online"); 67 notify_notification_set_category(notification, "presence.online");
59 else 68 else
@@ -63,7 +72,7 @@ _show_notification(UNUSED MESSENGER_Application *app,
63 notification, 72 notification,
64 "closed", 73 "closed",
65 G_CALLBACK(_close_notification), 74 G_CALLBACK(_close_notification),
66 NULL 75 app
67 ); 76 );
68 77
69 notify_notification_show(notification, NULL); 78 notify_notification_show(notification, NULL);