summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-02-25 15:45:33 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-02-26 10:31:07 +0100
commitaa643f1836a732d0b849d465b7777ac3265ef9a4 (patch)
tree5abcd140118d79241b2601431fe1aa2333185355
parent5ecb253be2a30f7bbde601aeed65f75acb7476ae (diff)
add tp_account_channel_request_set_conference_initial_channels()
-rw-r--r--docs/reference/telepathy-glib-sections.txt1
-rw-r--r--telepathy-glib/account-channel-request.c35
-rw-r--r--telepathy-glib/account-channel-request.h7
-rw-r--r--tests/dbus/account-channel-request.c14
4 files changed, 56 insertions, 1 deletions
diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt
index f75e5aebd..889d272fd 100644
--- a/docs/reference/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib-sections.txt
@@ -6283,6 +6283,7 @@ tp_account_channel_request_set_target_id
tp_account_channel_request_set_request_property
tp_account_channel_request_new_text
tp_account_channel_request_set_sms_channel
+tp_account_channel_request_set_conference_initial_channels
tp_account_channel_request_new_audio_call
tp_account_channel_request_new_audio_video_call
tp_account_channel_request_new_file_transfer
diff --git a/telepathy-glib/account-channel-request.c b/telepathy-glib/account-channel-request.c
index da71b8741..656cbd100 100644
--- a/telepathy-glib/account-channel-request.c
+++ b/telepathy-glib/account-channel-request.c
@@ -2546,3 +2546,38 @@ tp_account_channel_request_set_sms_channel (TpAccountChannelRequest *self,
g_strdup (TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL),
tp_g_value_slice_new_boolean (is_sms_channel));
}
+
+/**
+ * tp_account_channel_request_set_conference_initial_channels:
+ * @self: a #TpAccountChannelRequest
+ * @channels: a #NULL-terminated array of channel paths
+ *
+ * Indicate that the channel which is going to be requested using @self
+ * is an upgrade of the channels whose object paths is listed in @channels.
+ *
+ * This function can't be called once @self has been used to request a
+ * channel.
+ *
+ * Since: UNRELEASED
+ */
+void
+tp_account_channel_request_set_conference_initial_channels (
+ TpAccountChannelRequest *self,
+ const gchar * const * channels)
+{
+ GPtrArray *chans;
+ guint i;
+
+ g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self));
+ g_return_if_fail (!self->priv->requested);
+
+ chans = g_ptr_array_new ();
+ for (i = 0; channels != NULL && channels[i] != NULL; i++)
+ g_ptr_array_add (chans, (gpointer) channels[i]);
+
+ g_hash_table_insert (self->priv->request,
+ g_strdup (TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_CHANNELS),
+ tp_g_value_slice_new_boxed (TP_ARRAY_TYPE_OBJECT_PATH_LIST, chans));
+
+ g_ptr_array_unref (chans);
+}
diff --git a/telepathy-glib/account-channel-request.h b/telepathy-glib/account-channel-request.h
index 2077ff7fe..962c0ff5f 100644
--- a/telepathy-glib/account-channel-request.h
+++ b/telepathy-glib/account-channel-request.h
@@ -176,6 +176,13 @@ TpAccountChannelRequest *tp_account_channel_request_new_dbus_tube (
const gchar *service_name,
gint64 user_action_time) G_GNUC_WARN_UNUSED_RESULT;
+/* Conference */
+
+_TP_AVAILABLE_IN_0_24
+void tp_account_channel_request_set_conference_initial_channels (
+ TpAccountChannelRequest *self,
+ const gchar * const * channels);
+
/* Channel target (shared between all channel types) */
_TP_AVAILABLE_IN_0_20
diff --git a/tests/dbus/account-channel-request.c b/tests/dbus/account-channel-request.c
index 401a46c78..410e582f4 100644
--- a/tests/dbus/account-channel-request.c
+++ b/tests/dbus/account-channel-request.c
@@ -1318,9 +1318,13 @@ test_no_handle_type (Test *test,
{
TpAccountChannelRequest *req;
gboolean valid;
+ const gchar * const channels[] = { "/chan1", "/chan2", NULL };
+ GPtrArray *chans;
req = tp_account_channel_request_new_text (test->account, 0);
+ tp_account_channel_request_set_conference_initial_channels (req, channels);
+
/* Ask to the CR to fire the signal */
tp_account_channel_request_set_request_property (req, "FireFailed",
g_variant_new_boolean (TRUE));
@@ -1342,8 +1346,16 @@ test_no_handle_type (Test *test,
g_assert (valid);
g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request,
"FireFailed", NULL), ==, TRUE);
- g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 3);
+ g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 4);
g_assert_cmpuint (test->cd_service->last_user_action_time, ==, 0);
+
+ chans = tp_asv_get_boxed (test->cd_service->last_request,
+ TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_CHANNELS,
+ TP_ARRAY_TYPE_OBJECT_PATH_LIST);
+ g_assert (chans != NULL);
+ g_assert_cmpuint (chans->len, ==, 2);
+ g_assert_cmpstr (g_ptr_array_index (chans, 0), ==, "/chan1");
+ g_assert_cmpstr (g_ptr_array_index (chans, 1), ==, "/chan2");
}
int