aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2013-08-19 19:02:46 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2013-08-19 19:45:53 +0800
commitd354e170b39901c06b927534318fbd24cb0ee95f (patch)
tree94706be510d29647141cde321b95fc41e317f613 /src
parent831d0d218b0a8a257dca4e7c96bdc264595a8a6f (diff)
downloadgsoc2013-empathy-d354e170b39901c06b927534318fbd24cb0ee95f.tar
gsoc2013-empathy-d354e170b39901c06b927534318fbd24cb0ee95f.tar.gz
gsoc2013-empathy-d354e170b39901c06b927534318fbd24cb0ee95f.tar.bz2
gsoc2013-empathy-d354e170b39901c06b927534318fbd24cb0ee95f.tar.lz
gsoc2013-empathy-d354e170b39901c06b927534318fbd24cb0ee95f.tar.xz
gsoc2013-empathy-d354e170b39901c06b927534318fbd24cb0ee95f.tar.zst
gsoc2013-empathy-d354e170b39901c06b927534318fbd24cb0ee95f.zip
Do not ring on incoming calls when busy
Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> https://bugzilla.gnome.org/show_bug.cgi?id=666221
Diffstat (limited to 'src')
-rw-r--r--src/empathy-event-manager.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index ea9ebc697..fd6e659b2 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -915,8 +915,19 @@ approve_call_channel (EmpathyEventManager *self,
priv->ringing++;
if (priv->ringing == 1)
- empathy_sound_manager_start_playing (priv->sound_mgr, NULL,
- EMPATHY_SOUND_PHONE_INCOMING, MS_BETWEEN_RING);
+ {
+ TpAccountManager *am = tp_account_manager_dup ();
+ TpConnectionPresenceType presence;
+
+ presence = tp_account_manager_get_most_available_presence (am,
+ NULL, NULL);
+
+ if (presence != TP_CONNECTION_PRESENCE_TYPE_BUSY)
+ empathy_sound_manager_start_playing (priv->sound_mgr, NULL,
+ EMPATHY_SOUND_PHONE_INCOMING, MS_BETWEEN_RING);
+
+ g_object_unref (am);
+ }
}
static void
@@ -1363,7 +1374,7 @@ empathy_event_manager_init (EmpathyEventManager *manager)
g_ptr_array_unref (contacts);
g_ptr_array_unref (empty);
- am = tp_account_manager_dup ();
+ am = tp_account_manager_dup ();
priv->approver = tp_simple_approver_new_with_am (am, "Empathy.EventManager",
FALSE, approve_channels, manager, NULL);