aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-call.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-06-21 22:21:34 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-06-22 17:59:33 +0800
commiteafc9830daea1f750be9b68d7360a8b4b8345e5a (patch)
treee5679a33ee092371ff5c2d1ce1e19b638bc62d31 /libempathy/empathy-tp-call.c
parentf20aa2a8401a472c6d9d2ffa0979ae8169f1df85 (diff)
downloadgsoc2013-empathy-eafc9830daea1f750be9b68d7360a8b4b8345e5a.tar
gsoc2013-empathy-eafc9830daea1f750be9b68d7360a8b4b8345e5a.tar.gz
gsoc2013-empathy-eafc9830daea1f750be9b68d7360a8b4b8345e5a.tar.bz2
gsoc2013-empathy-eafc9830daea1f750be9b68d7360a8b4b8345e5a.tar.lz
gsoc2013-empathy-eafc9830daea1f750be9b68d7360a8b4b8345e5a.tar.xz
gsoc2013-empathy-eafc9830daea1f750be9b68d7360a8b4b8345e5a.tar.zst
gsoc2013-empathy-eafc9830daea1f750be9b68d7360a8b4b8345e5a.zip
tp-call: use the Requested property to check if the call is an incoming one or not
Diffstat (limited to 'libempathy/empathy-tp-call.c')
-rw-r--r--libempathy/empathy-tp-call.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/libempathy/empathy-tp-call.c b/libempathy/empathy-tp-call.c
index 3aae89fce..4c78649a0 100644
--- a/libempathy/empathy-tp-call.c
+++ b/libempathy/empathy-tp-call.c
@@ -61,7 +61,6 @@ enum
PROP_0,
PROP_CHANNEL,
PROP_CONTACT,
- PROP_IS_INCOMING,
PROP_STATUS,
PROP_AUDIO_STREAM,
PROP_VIDEO_STREAM
@@ -279,9 +278,7 @@ tp_call_got_contact_cb (TpConnection *connection,
}
priv->contact = g_object_ref (contact);
- priv->is_incoming = TRUE;
priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
- g_object_notify (G_OBJECT (call), "is-incoming");
g_object_notify (G_OBJECT (call), "contact");
g_object_notify (G_OBJECT (call), "status");
}
@@ -333,9 +330,7 @@ empathy_tp_call_to (EmpathyTpCall *call, EmpathyContact *contact,
g_assert (audio || video);
priv->contact = g_object_ref (contact);
- priv->is_incoming = FALSE;
priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
- g_object_notify (G_OBJECT (call), "is-incoming");
g_object_notify (G_OBJECT (call), "contact");
g_object_notify (G_OBJECT (call), "status");
@@ -407,6 +402,8 @@ tp_call_constructor (GType type,
GObject *object;
EmpathyTpCall *call;
EmpathyTpCallPriv *priv;
+ GHashTable *props;
+ gboolean requested;
object = G_OBJECT_CLASS (empathy_tp_call_parent_class)->constructor (type,
n_construct_params, construct_params);
@@ -430,6 +427,12 @@ tp_call_constructor (GType type,
tp_cli_channel_type_streamed_media_call_list_streams (priv->channel, -1,
tp_call_request_streams_cb, NULL, NULL, G_OBJECT (call));
+ /* Is the call incoming? */
+ props = tp_channel_borrow_immutable_properties (priv->channel);
+ requested = tp_asv_get_boolean (props, TP_PROP_CHANNEL_REQUESTED, NULL);
+
+ priv->is_incoming = !requested;
+
/* Update status when members changes */
tp_call_update_status (call);
g_signal_connect_swapped (priv->channel, "group-members-changed",
@@ -513,9 +516,6 @@ tp_call_get_property (GObject *object,
case PROP_CONTACT:
g_value_set_object (value, priv->contact);
break;
- case PROP_IS_INCOMING:
- g_value_set_boolean (value, priv->is_incoming);
- break;
case PROP_STATUS:
g_value_set_uint (value, priv->status);
break;
@@ -553,10 +553,6 @@ empathy_tp_call_class_init (EmpathyTpCallClass *klass)
g_param_spec_object ("contact", "Call contact", "Call contact",
EMPATHY_TYPE_CONTACT,
G_PARAM_READABLE | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
- g_object_class_install_property (object_class, PROP_IS_INCOMING,
- g_param_spec_boolean ("is-incoming", "Is media stream incoming",
- "Is media stream incoming", FALSE, G_PARAM_READABLE |
- G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_class_install_property (object_class, PROP_STATUS,
g_param_spec_uint ("status", "Call status",
"Call status", 0, 255, 0, G_PARAM_READABLE | G_PARAM_STATIC_NICK |