diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-31 01:07:42 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-31 01:07:42 +0800 |
commit | 5e818246cfc20394b14756d872145b853a53296c (patch) | |
tree | c9361992b451f4cfee4a2b8f4172a34ee8b7ad6b /src/empathy-event-manager.c | |
parent | f83fcbd246277115aa1e32479fd8a02f4cf73f08 (diff) | |
download | gsoc2013-empathy-5e818246cfc20394b14756d872145b853a53296c.tar.gz gsoc2013-empathy-5e818246cfc20394b14756d872145b853a53296c.tar.zst gsoc2013-empathy-5e818246cfc20394b14756d872145b853a53296c.zip |
Make notifications for unfocused chat windows work properly.
svn path=/trunk/; revision=2287
Diffstat (limited to 'src/empathy-event-manager.c')
-rw-r--r-- | src/empathy-event-manager.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index 2ff88f948..3d49127fe 100644 --- a/src/empathy-event-manager.c +++ b/src/empathy-event-manager.c @@ -182,6 +182,23 @@ event_channel_process_func (EventPriv *event) empathy_dispatch_operation_approve (event->approval->operation); } +static void +event_text_channel_process_func (EventPriv *event) +{ + EmpathyTpChat *tp_chat; + + if (event->approval->handler != 0) + { + tp_chat = EMPATHY_TP_CHAT + (empathy_dispatch_operation_get_channel_wrapper (event->approval->operation)); + + g_signal_handler_disconnect (tp_chat, event->approval->handler); + event->approval->handler = 0; + } + + empathy_dispatch_operation_approve (event->approval->operation); +} + static EventPriv * event_lookup_by_approval (EmpathyEventManager *manager, EventManagerApproval *approval) @@ -233,10 +250,10 @@ event_manager_chat_message_received_cb (EmpathyTpChat *tp_chat, * queue. */ event = event_lookup_by_approval (approval->manager, approval); - if (event != NULL && event->inhibit) + if (event != NULL && event->inhibit && approval->handler != 0) { - g_signal_handlers_disconnect_by_func (tp_chat, - event_manager_chat_message_received_cb, approval); + g_signal_handler_disconnect (tp_chat, approval->handler); + approval->handler = 0; return; } @@ -251,7 +268,7 @@ event_manager_chat_message_received_cb (EmpathyTpChat *tp_chat, 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); + msg, approval, event_text_channel_process_func, NULL); g_free (header); } @@ -461,7 +478,7 @@ event_manager_approve_channel_cb (EmpathyDispatcher *dispatcher, EMPATHY_TP_CHAT ( empathy_dispatch_operation_get_channel_wrapper (operation)); - g_signal_connect (tp_chat, "message-received", + approval->handler = g_signal_connect (tp_chat, "message-received", G_CALLBACK (event_manager_chat_message_received_cb), approval); } |