diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-31 01:07:15 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-31 01:07:15 +0800 |
commit | a597d3012d2b09b0c453fab9725223137d42327f (patch) | |
tree | f4186734e220973e8b4dc783edaf63a6120ef216 /src/empathy-event-manager.c | |
parent | aec95ff0ec211bb0c5d65e599033e9e60f18b29c (diff) | |
download | gsoc2013-empathy-a597d3012d2b09b0c453fab9725223137d42327f.tar gsoc2013-empathy-a597d3012d2b09b0c453fab9725223137d42327f.tar.gz gsoc2013-empathy-a597d3012d2b09b0c453fab9725223137d42327f.tar.bz2 gsoc2013-empathy-a597d3012d2b09b0c453fab9725223137d42327f.tar.lz gsoc2013-empathy-a597d3012d2b09b0c453fab9725223137d42327f.tar.xz gsoc2013-empathy-a597d3012d2b09b0c453fab9725223137d42327f.tar.zst gsoc2013-empathy-a597d3012d2b09b0c453fab9725223137d42327f.zip |
If the notification is not dismissed by the user, do not display other notifications for new incoming messages.
svn path=/trunk/; revision=2279
Diffstat (limited to 'src/empathy-event-manager.c')
-rw-r--r-- | src/empathy-event-manager.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index 42eadf411..253067ff1 100644 --- a/src/empathy-event-manager.c +++ b/src/empathy-event-manager.c @@ -76,6 +76,7 @@ struct _EventPriv { EmpathyEventManager *manager; EventManagerApproval *approval; EventFunc func; + gboolean inhibit; gpointer user_data; }; @@ -164,6 +165,7 @@ event_manager_add (EmpathyEventManager *manager, EmpathyContact *contact, event->public.icon_name = g_strdup (icon_name); event->public.header = g_strdup (header); event->public.message = g_strdup (message); + event->inhibit = FALSE; event->func = func; event->user_data = user_data; event->manager = manager; @@ -226,11 +228,18 @@ event_manager_chat_message_received_cb (EmpathyTpChat *tp_chat, TpChannel *channel; EventPriv *event; - /* update the event if it's referring to a chat which is already in the + /* try to update the event if it's referring to a chat which is already in the * queue. */ event = event_lookup_by_approval (approval->manager, approval); + if (event != NULL && event->inhibit) + { + g_signal_handlers_disconnect_by_func (tp_chat, + event_manager_chat_message_received_cb, approval); + return; + } + sender = empathy_message_get_sender (message); header = g_strdup_printf (_("New message from %s"), empathy_contact_get_name (sender)); @@ -239,7 +248,7 @@ event_manager_chat_message_received_cb (EmpathyTpChat *tp_chat, channel = empathy_tp_chat_get_channel (tp_chat); if (event != NULL) - event_update (approval->manager, event, EMPATHY_IMAGE_NEW_MESSAGE, header, msg); + event_update (approval->manager, event, EMPATHY_IMAGE_NEW_MESSAGE, header, msg); else event_manager_add (approval->manager, sender, EMPATHY_IMAGE_NEW_MESSAGE, header, msg, approval, event_channel_process_func, NULL); @@ -728,3 +737,14 @@ empathy_event_activate (EmpathyEvent *event_public) else event_remove (event); } + +void +empathy_event_inhibit_updates (EmpathyEvent *event_public) +{ + EventPriv *event = (EventPriv *) event_public; + + g_return_if_fail (event_public != NULL); + + event->inhibit = TRUE; +} + |