[telepathy-gabble/master] Implement SetSending and ensure the Senders property stays in sync
Sjoerd Simons
sjoerd.simons at collabora.co.uk
Mon Dec 14 06:53:32 PST 2009
---
src/call-stream.c | 37 +++++++++++++++++++++++++++++++++++--
1 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/src/call-stream.c b/src/call-stream.c
index 03c62d7..d8f1edb 100644
--- a/src/call-stream.c
+++ b/src/call-stream.c
@@ -301,7 +301,17 @@ google_relay_session_cb (GPtrArray *relays,
}
static void
-session_state_changed_cb (GabbleJingleContent *content,
+content_state_changed_cb (GabbleJingleContent *content,
+ GParamSpec *spec,
+ gpointer user_data)
+{
+ GabbleCallStream *self = GABBLE_CALL_STREAM (user_data);
+
+ call_stream_update_sender_states (self);
+}
+
+static void
+content_senders_changed_cb (GabbleJingleContent *content,
GParamSpec *spec,
gpointer user_data)
{
@@ -351,7 +361,9 @@ gabble_call_stream_constructed (GObject *obj)
call_stream_update_sender_states (GABBLE_CALL_STREAM (obj));
gabble_signal_connect_weak (priv->content, "notify::state",
- G_CALLBACK (session_state_changed_cb), obj);
+ G_CALLBACK (content_state_changed_cb), obj);
+ gabble_signal_connect_weak (priv->content, "notify::senders",
+ G_CALLBACK (content_senders_changed_cb), obj);
if (G_OBJECT_CLASS (gabble_call_stream_parent_class)->constructed != NULL)
G_OBJECT_CLASS (gabble_call_stream_parent_class)->constructed (obj);
@@ -673,8 +685,29 @@ gabble_call_stream_candidates_prepared (
}
static void
+gabble_call_stream_set_sending (GabbleSvcCallStream *iface,
+ gboolean sending,
+ DBusGMethodInvocation *context)
+{
+ GabbleCallStream *self = GABBLE_CALL_STREAM (iface);
+ GabbleCallStreamPrivate *priv = self->priv;
+
+ DEBUG ("Badgers: %d\n", sending);
+ gabble_jingle_content_set_sending (priv->content, sending);
+
+ gabble_svc_call_stream_return_from_set_sending (context);
+}
+
+static void
call_stream_iface_init (gpointer g_iface, gpointer iface_data)
{
+ GabbleSvcCallStreamClass *klass =
+ (GabbleSvcCallStreamClass *) g_iface;
+
+#define IMPLEMENT(x) gabble_svc_call_stream_implement_##x (\
+ klass, gabble_call_stream_##x)
+ IMPLEMENT(set_sending);
+#undef IMPLEMENT
}
static void
--
1.5.6.5
More information about the telepathy-commits
mailing list