aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-30 18:29:35 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-30 19:00:09 +0800
commite1db5549ea2349d0d17509171ffe7f977676acb7 (patch)
tree72d2f5950a0aeeb85134cc3b334fa709a6c73b78 /src
parent19cbd39e5eb916ecc4dc2f0705a204d0c7ca6e3a (diff)
downloadgsoc2013-empathy-e1db5549ea2349d0d17509171ffe7f977676acb7.tar
gsoc2013-empathy-e1db5549ea2349d0d17509171ffe7f977676acb7.tar.gz
gsoc2013-empathy-e1db5549ea2349d0d17509171ffe7f977676acb7.tar.bz2
gsoc2013-empathy-e1db5549ea2349d0d17509171ffe7f977676acb7.tar.lz
gsoc2013-empathy-e1db5549ea2349d0d17509171ffe7f977676acb7.tar.xz
gsoc2013-empathy-e1db5549ea2349d0d17509171ffe7f977676acb7.tar.zst
gsoc2013-empathy-e1db5549ea2349d0d17509171ffe7f977676acb7.zip
Revert "Don't look for Call channels"
Since we support Call in master nowadays. This reverts commit 5b894aa5ad8702279c0458b890025a22172bfdd1. https://bugzilla.gnome.org/show_bug.cgi?id=653730
Diffstat (limited to 'src')
-rw-r--r--src/empathy-call-observer.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/empathy-call-observer.c b/src/empathy-call-observer.c
index c6ba53c95..8ce57a3e1 100644
--- a/src/empathy-call-observer.c
+++ b/src/empathy-call-observer.c
@@ -24,6 +24,8 @@
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-yell/telepathy-yell.h>
+
#include <libnotify/notification.h>
#include <libempathy/empathy-channel-factory.h>
@@ -183,7 +185,8 @@ find_main_channel (GList *channels)
channel_type = tp_channel_get_channel_type_id (channel);
- if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA)
+ if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA ||
+ channel_type == TPY_IFACE_QUARK_CHANNEL_TYPE_CALL)
return channel;
}
@@ -193,8 +196,21 @@ find_main_channel (GList *channels)
static gboolean
has_ongoing_calls (EmpathyCallObserver *self)
{
- if (self->priv->channels != NULL)
- return TRUE;
+ GList *l;
+
+ for (l = self->priv->channels; l != NULL; l = l->next)
+ {
+ TpChannel *channel = TP_CHANNEL (l->data);
+ GQuark type = tp_channel_get_channel_type_id (channel);
+
+ /* Check that Call channels are not ended */
+ if (type == TPY_IFACE_QUARK_CHANNEL_TYPE_CALL &&
+ tpy_call_channel_get_state (TPY_CALL_CHANNEL (channel), NULL, NULL)
+ == TPY_CALL_STATE_ENDED)
+ continue;
+
+ return TRUE;
+ }
return FALSE;
}
@@ -358,7 +374,7 @@ empathy_call_observer_init (EmpathyCallObserver *self)
TP_CLIENT_CHANNEL_FACTORY (factory));
g_object_unref (factory);
- /* Observe StreamedMedia channels */
+ /* Observe Call and StreamedMedia channels */
tp_base_client_take_observer_filter (self->priv->observer,
tp_asv_new (
TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
@@ -366,6 +382,13 @@ empathy_call_observer_init (EmpathyCallObserver *self)
TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
TP_HANDLE_TYPE_CONTACT,
NULL));
+ tp_base_client_take_observer_filter (self->priv->observer,
+ tp_asv_new (
+ TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
+ TPY_IFACE_CHANNEL_TYPE_CALL,
+ TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
+ TP_HANDLE_TYPE_CONTACT,
+ NULL));
tp_base_client_set_observer_delay_approvers (self->priv->observer, TRUE);