diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2010-05-23 18:57:31 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2010-05-26 17:34:59 +0800 |
commit | 58521ffc5dc4ca1b67ce3df25c16799237061f02 (patch) | |
tree | cf58f7d4f3884440d49903ffceb287fa84c78d89 /src/empathy-event-manager.c | |
parent | a3006260dcca6bac7a2f291389823584a136f2d8 (diff) | |
download | gsoc2013-empathy-58521ffc5dc4ca1b67ce3df25c16799237061f02.tar gsoc2013-empathy-58521ffc5dc4ca1b67ce3df25c16799237061f02.tar.gz gsoc2013-empathy-58521ffc5dc4ca1b67ce3df25c16799237061f02.tar.bz2 gsoc2013-empathy-58521ffc5dc4ca1b67ce3df25c16799237061f02.tar.lz gsoc2013-empathy-58521ffc5dc4ca1b67ce3df25c16799237061f02.tar.xz gsoc2013-empathy-58521ffc5dc4ca1b67ce3df25c16799237061f02.tar.zst gsoc2013-empathy-58521ffc5dc4ca1b67ce3df25c16799237061f02.zip |
Play sound for contact connected/disconnected from EmpathyEventManager instead of main window
Diffstat (limited to 'src/empathy-event-manager.c')
-rw-r--r-- | src/empathy-event-manager.c | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index 025eec564..932164c10 100644 --- a/src/empathy-event-manager.c +++ b/src/empathy-event-manager.c @@ -864,33 +864,45 @@ event_manager_presence_changed_cb (EmpathyContactMonitor *monitor, TP_CONNECTION_PRESENCE_TYPE_OFFLINE) > 0) { /* contact was online */ - empathy_conf_get_bool (empathy_conf_get (), - EMPATHY_PREFS_NOTIFICATIONS_CONTACT_SIGNOUT, &preference); - if (preference && tp_connection_presence_type_cmp_availability (current, + if (tp_connection_presence_type_cmp_availability (current, TP_CONNECTION_PRESENCE_TYPE_OFFLINE) <= 0) { /* someone is logging off */ - header = g_strdup_printf (_("%s is now offline."), - empathy_contact_get_name (contact)); + empathy_sound_play (empathy_main_window_get (), + EMPATHY_SOUND_CONTACT_DISCONNECTED); + + empathy_conf_get_bool (empathy_conf_get (), + EMPATHY_PREFS_NOTIFICATIONS_CONTACT_SIGNOUT, &preference); + if (preference) + { + header = g_strdup_printf (_("%s is now offline."), + empathy_contact_get_name (contact)); - event_manager_add (manager, contact, EMPATHY_EVENT_TYPE_PRESENCE, - EMPATHY_IMAGE_AVATAR_DEFAULT, header, NULL, NULL, NULL, NULL); + event_manager_add (manager, contact, EMPATHY_EVENT_TYPE_PRESENCE, + EMPATHY_IMAGE_AVATAR_DEFAULT, header, NULL, NULL, NULL, NULL); + } } } else { /* contact was offline */ - empathy_conf_get_bool (empathy_conf_get (), - EMPATHY_PREFS_NOTIFICATIONS_CONTACT_SIGNIN, &preference); if (preference && tp_connection_presence_type_cmp_availability (current, TP_CONNECTION_PRESENCE_TYPE_OFFLINE) > 0) { /* someone is logging in */ - header = g_strdup_printf (_("%s is now online."), - empathy_contact_get_name (contact)); + empathy_sound_play (empathy_main_window_get (), + EMPATHY_SOUND_CONTACT_CONNECTED); - event_manager_add (manager, contact, EMPATHY_EVENT_TYPE_PRESENCE, - EMPATHY_IMAGE_AVATAR_DEFAULT, header, NULL, NULL, NULL, NULL); + empathy_conf_get_bool (empathy_conf_get (), + EMPATHY_PREFS_NOTIFICATIONS_CONTACT_SIGNIN, &preference); + if (preference) + { + header = g_strdup_printf (_("%s is now online."), + empathy_contact_get_name (contact)); + + event_manager_add (manager, contact, EMPATHY_EVENT_TYPE_PRESENCE, + EMPATHY_IMAGE_AVATAR_DEFAULT, header, NULL, NULL, NULL, NULL); + } } } g_free (header); |