[telepathy-glib/master] ExampleCallableMediaChannel: stylistic fixes for Andre's Hold code
Simon McVittie
simon.mcvittie at collabora.co.uk
Mon Aug 17 09:50:53 PDT 2009
Whitespace, English, and avoiding C99
Reviewed-by: Will Thompson <will.thompson at collabora.co.uk>
---
examples/cm/callable/media-channel.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/examples/cm/callable/media-channel.c b/examples/cm/callable/media-channel.c
index 7c1e915..187ba58 100644
--- a/examples/cm/callable/media-channel.c
+++ b/examples/cm/callable/media-channel.c
@@ -1229,6 +1229,7 @@ static gboolean
simulate_hold (gpointer p)
{
ExampleCallableMediaChannel *self = p;
+
self->priv->hold_state = TP_LOCAL_HOLD_STATE_HELD;
g_message ("SIGNALLING: hold state changed to held");
tp_svc_channel_interface_hold_emit_hold_state_changed (self,
@@ -1240,6 +1241,7 @@ static gboolean
simulate_unhold (gpointer p)
{
ExampleCallableMediaChannel *self = p;
+
self->priv->hold_state = TP_LOCAL_HOLD_STATE_UNHELD;
g_message ("SIGNALLING: hold state changed to unheld");
tp_svc_channel_interface_hold_emit_hold_state_changed (self,
@@ -1248,14 +1250,16 @@ simulate_unhold (gpointer p)
}
static gboolean
-simulate_inability_unhold (gpointer p)
+simulate_inability_to_unhold (gpointer p)
{
ExampleCallableMediaChannel *self = p;
+
self->priv->hold_state = TP_LOCAL_HOLD_STATE_PENDING_HOLD;
- g_message ("SIGNALLING: unable to unhold - hold state changed to pending hold");
+ g_message ("SIGNALLING: unable to unhold - hold state changed to "
+ "pending hold");
tp_svc_channel_interface_hold_emit_hold_state_changed (self,
self->priv->hold_state, self->priv->hold_state_reason);
- // hold again
+ /* hold again */
g_timeout_add_full (G_PRIORITY_DEFAULT,
self->priv->simulation_delay,
simulate_hold, g_object_ref (self),
@@ -1268,6 +1272,7 @@ hold_get_hold_state (TpSvcChannelInterfaceHold *iface,
DBusGMethodInvocation *context)
{
ExampleCallableMediaChannel *self = EXAMPLE_CALLABLE_MEDIA_CHANNEL (iface);
+
tp_svc_channel_interface_hold_return_from_get_hold_state (context,
self->priv->hold_state, self->priv->hold_state_reason);
}
@@ -1292,6 +1297,7 @@ hold_request_hold (TpSvcChannelInterfaceHold *iface,
}
peer = tp_handle_inspect (contact_repo, self->priv->handle);
+
if (!hold && strstr (peer, "(no unhold)") != NULL)
{
g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
@@ -1300,6 +1306,7 @@ hold_request_hold (TpSvcChannelInterfaceHold *iface,
}
self->priv->hold_state_reason = TP_LOCAL_HOLD_STATE_REASON_REQUESTED;
+
if (hold)
{
self->priv->hold_state = TP_LOCAL_HOLD_STATE_PENDING_HOLD;
@@ -1310,9 +1317,10 @@ hold_request_hold (TpSvcChannelInterfaceHold *iface,
self->priv->hold_state = TP_LOCAL_HOLD_STATE_PENDING_UNHOLD;
peer = tp_handle_inspect (contact_repo, self->priv->handle);
+
if (strstr (peer, "(inability to unhold)") != NULL)
{
- callback = simulate_inability_unhold;
+ callback = simulate_inability_to_unhold;
}
else
{
--
1.5.6.5
More information about the telepathy-commits
mailing list