summaryrefslogtreecommitdiff
path: root/telepathy-glib/base-call-stream.c
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2011-12-26 20:56:50 -0500
committerXavier Claessens <xavier.claessens@collabora.co.uk>2012-01-10 09:52:46 +0100
commitaae1ccf8c6fde76f7728aa921d0bacb138ad5440 (patch)
treefa6ee3c2df93532a60e167f2b2e79919541716e3 /telepathy-glib/base-call-stream.c
parent8aa61104494698debae8df3c11bc9df672c6dbc9 (diff)
downloadtelepathy-glib-aae1ccf8c6fde76f7728aa921d0bacb138ad5440.tar.gz
Set the sending and receiving directions correctly
Diffstat (limited to 'telepathy-glib/base-call-stream.c')
-rw-r--r--telepathy-glib/base-call-stream.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/telepathy-glib/base-call-stream.c b/telepathy-glib/base-call-stream.c
index 30cff81b7..49cb6321f 100644
--- a/telepathy-glib/base-call-stream.c
+++ b/telepathy-glib/base-call-stream.c
@@ -500,6 +500,12 @@ tp_base_call_stream_update_local_sending_state (TpBaseCallStream *self,
g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), FALSE);
+ if (new_state == TP_SENDING_STATE_SENDING &&
+ self->priv->channel != NULL &&
+ !tp_base_call_channel_is_accepted (self->priv->channel) &&
+ !tp_base_channel_is_requested (TP_BASE_CHANNEL (self->priv->channel)))
+ new_state = TP_SENDING_STATE_PENDING_SEND;
+
if (self->priv->local_sending_state == new_state)
return FALSE;
@@ -584,6 +590,12 @@ tp_base_call_stream_update_remote_sending_state (TpBaseCallStream *self,
g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), FALSE);
+ if (new_state == TP_SENDING_STATE_SENDING &&
+ self->priv->channel != NULL &&
+ tp_base_channel_is_requested (TP_BASE_CHANNEL (self->priv->channel)) &&
+ !tp_base_call_channel_is_accepted (self->priv->channel))
+ new_state = TP_SENDING_STATE_PENDING_SEND;
+
exists = g_hash_table_lookup_extended (self->priv->remote_members,
GUINT_TO_POINTER (contact), NULL, &state_p);
@@ -684,7 +696,7 @@ tp_base_call_stream_set_sending_dbus (TpSvcCallStream *iface,
if (_tp_base_call_stream_set_sending (TP_BASE_CALL_STREAM (iface), sending,
tp_base_channel_get_self_handle ((TpBaseChannel *) self->priv->channel),
TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "",
- "User changed the sendingt state", &error))
+ "User changed the sending state", &error))
{
tp_svc_call_stream_return_from_set_sending (context);
}