summaryrefslogtreecommitdiff
path: root/telepathy-glib/base-call-channel.c
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.co.uk>2012-01-02 11:15:37 +0100
committerXavier Claessens <xavier.claessens@collabora.co.uk>2012-01-10 09:52:47 +0100
commitf49f8ee72edff473a34605a3bfd9b44cf29eeef3 (patch)
treeac4da54d0d9d16bb507c3351a34acabc578a3b6e /telepathy-glib/base-call-channel.c
parent0c097231f467745dca59767adad5eba687cb8e8a (diff)
downloadtelepathy-glib-f49f8ee72edff473a34605a3bfd9b44cf29eeef3.tar.gz
TpBaseCallChannel: move code around to group public methods
Diffstat (limited to 'telepathy-glib/base-call-channel.c')
-rw-r--r--telepathy-glib/base-call-channel.c121
1 files changed, 62 insertions, 59 deletions
diff --git a/telepathy-glib/base-call-channel.c b/telepathy-glib/base-call-channel.c
index 474e161d8..ad08a7817 100644
--- a/telepathy-glib/base-call-channel.c
+++ b/telepathy-glib/base-call-channel.c
@@ -1099,6 +1099,66 @@ tp_base_call_channel_remove_member (TpBaseCallChannel *self,
g_value_array_free (reason_array);
}
+GHashTable *
+tp_base_call_channel_get_call_members (TpBaseCallChannel *self)
+{
+ g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), NULL);
+
+ return self->priv->call_members;
+}
+
+void
+tp_base_call_channel_remote_accept (TpBaseCallChannel *self)
+{
+ TpBaseCallChannelClass *klass = TP_BASE_CALL_CHANNEL_GET_CLASS (self);
+
+ g_return_if_fail (tp_base_channel_is_requested (TP_BASE_CHANNEL (self)));
+
+ if (self->priv->accepted)
+ return;
+
+ g_return_if_fail (self->priv->state == TP_CALL_STATE_INITIALISED ||
+ self->priv->state == TP_CALL_STATE_INITIALISING);
+
+ self->priv->accepted = TRUE;
+
+ tp_base_call_channel_set_state (self,
+ TP_CALL_STATE_ACCEPTED,
+ 0, TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "");
+
+ if (klass->remote_accept)
+ klass->remote_accept (self);
+}
+
+gboolean
+tp_base_call_channel_is_accepted (TpBaseCallChannel *self)
+{
+ g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), FALSE);
+
+ return self->priv->accepted;
+}
+
+gboolean
+tp_base_call_channel_is_locally_accepted (TpBaseCallChannel *self)
+{
+ g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), FALSE);
+
+ return self->priv->locally_accepted;
+}
+
+gboolean
+tp_base_call_channel_is_connected (TpBaseCallChannel *self)
+{
+ TpBaseCallChannelClass *klass = TP_BASE_CALL_CHANNEL_GET_CLASS (self);
+
+ if (klass->is_connected)
+ return klass->is_connected (self);
+ else
+ return TRUE;
+}
+
+/* DBus method implementation */
+
static void
tp_base_call_channel_set_ringing (TpSvcChannelTypeCall *iface,
DBusGMethodInvocation *context)
@@ -1180,40 +1240,6 @@ tp_base_call_channel_set_queued (TpSvcChannelTypeCall *iface,
}
}
-gboolean
-tp_base_call_channel_is_connected (TpBaseCallChannel *self)
-{
- TpBaseCallChannelClass *klass = TP_BASE_CALL_CHANNEL_GET_CLASS (self);
-
- if (klass->is_connected)
- return klass->is_connected (self);
- else
- return TRUE;
-}
-
-void
-tp_base_call_channel_remote_accept (TpBaseCallChannel *self)
-{
- TpBaseCallChannelClass *klass = TP_BASE_CALL_CHANNEL_GET_CLASS (self);
-
- g_return_if_fail (tp_base_channel_is_requested (TP_BASE_CHANNEL (self)));
-
- if (self->priv->accepted)
- return;
-
- g_return_if_fail (self->priv->state == TP_CALL_STATE_INITIALISED ||
- self->priv->state == TP_CALL_STATE_INITIALISING);
-
- self->priv->accepted = TRUE;
-
- tp_base_call_channel_set_state (self,
- TP_CALL_STATE_ACCEPTED,
- 0, TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "");
-
- if (klass->remote_accept)
- klass->remote_accept (self);
-}
-
static void
tp_base_call_channel_accept (TpSvcChannelTypeCall *iface,
DBusGMethodInvocation *context)
@@ -1276,7 +1302,6 @@ tp_base_call_channel_accept_real (TpBaseCallChannel *self)
(GFunc) _tp_base_call_content_accepted, NULL);
}
-
static void
tp_base_call_channel_hangup (TpSvcChannelTypeCall *iface,
guint reason,
@@ -1374,6 +1399,8 @@ call_iface_init (gpointer g_iface, gpointer iface_data)
#undef IMPLEMENT
}
+/* Internal functions */
+
void
_tp_base_call_channel_set_locally_muted (TpBaseCallChannel *self,
gboolean locally_muted)
@@ -1392,27 +1419,3 @@ _tp_base_call_channel_set_locally_muted (TpBaseCallChannel *self,
tp_svc_channel_type_call_emit_call_state_changed (self, self->priv->state,
self->priv->flags, self->priv->reason, self->priv->details);
}
-
-gboolean
-tp_base_call_channel_is_accepted (TpBaseCallChannel *self)
-{
- g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), FALSE);
-
- return self->priv->accepted;
-}
-
-gboolean
-tp_base_call_channel_is_locally_accepted (TpBaseCallChannel *self)
-{
- g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), FALSE);
-
- return self->priv->locally_accepted;
-}
-
-GHashTable *
-tp_base_call_channel_get_call_members (TpBaseCallChannel *self)
-{
- g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), NULL);
-
- return self->priv->call_members;
-}