summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/reference/telepathy-glib-sections.txt1
-rw-r--r--telepathy-glib/account-channel-request.c27
-rw-r--r--telepathy-glib/account-channel-request.h5
-rw-r--r--tests/dbus/account-channel-request.c15
4 files changed, 47 insertions, 1 deletions
diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt
index 889d272fd..465ee1bff 100644
--- a/docs/reference/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib-sections.txt
@@ -6284,6 +6284,7 @@ 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_set_initial_invitee_ids
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 656cbd100..b8b127e23 100644
--- a/telepathy-glib/account-channel-request.c
+++ b/telepathy-glib/account-channel-request.c
@@ -2581,3 +2581,30 @@ tp_account_channel_request_set_conference_initial_channels (
g_ptr_array_unref (chans);
}
+
+/**
+ * tp_account_channel_request_set_initial_invitee_ids:
+ * @self: a #TpAccountChannelRequest
+ * @ids: a #NULL-terminated array of contact ids
+ *
+ * Indicate that the contacts listed in @ids have to be invited to the
+ * conference represented by the channel which is going to be requested
+ * using @self.
+ *
+ * This function can't be called once @self has been used to request a
+ * channel.
+ *
+ * Since: UNRELEASED
+ */
+void
+tp_account_channel_request_set_initial_invitee_ids (
+ TpAccountChannelRequest *self,
+ const gchar * const * ids)
+{
+ g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self));
+ g_return_if_fail (!self->priv->requested);
+
+ g_hash_table_insert (self->priv->request,
+ g_strdup (TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS),
+ tp_g_value_slice_new_boxed (G_TYPE_STRV, ids));
+}
diff --git a/telepathy-glib/account-channel-request.h b/telepathy-glib/account-channel-request.h
index 962c0ff5f..f414e888f 100644
--- a/telepathy-glib/account-channel-request.h
+++ b/telepathy-glib/account-channel-request.h
@@ -183,6 +183,11 @@ void tp_account_channel_request_set_conference_initial_channels (
TpAccountChannelRequest *self,
const gchar * const * channels);
+_TP_AVAILABLE_IN_0_24
+void tp_account_channel_request_set_initial_invitee_ids (
+ TpAccountChannelRequest *self,
+ const gchar * const * ids);
+
/* 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 410e582f4..258ec6d63 100644
--- a/tests/dbus/account-channel-request.c
+++ b/tests/dbus/account-channel-request.c
@@ -1320,11 +1320,16 @@ test_no_handle_type (Test *test,
gboolean valid;
const gchar * const channels[] = { "/chan1", "/chan2", NULL };
GPtrArray *chans;
+ const gchar * const invitees[] = { "badger@badger.com",
+ "snake@badger.com", NULL };
+ const gchar * const *strv;
req = tp_account_channel_request_new_text (test->account, 0);
tp_account_channel_request_set_conference_initial_channels (req, channels);
+ tp_account_channel_request_set_initial_invitee_ids (req, invitees);
+
/* Ask to the CR to fire the signal */
tp_account_channel_request_set_request_property (req, "FireFailed",
g_variant_new_boolean (TRUE));
@@ -1346,7 +1351,7 @@ 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), ==, 4);
+ g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 5);
g_assert_cmpuint (test->cd_service->last_user_action_time, ==, 0);
chans = tp_asv_get_boxed (test->cd_service->last_request,
@@ -1356,6 +1361,14 @@ test_no_handle_type (Test *test,
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");
+
+ strv = tp_asv_get_boxed (test->cd_service->last_request,
+ TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS,
+ G_TYPE_STRV);
+ g_assert (strv != NULL);
+ g_assert_cmpuint (g_strv_length ((GStrv) strv), ==, 2);
+ g_assert (tp_strv_contains (strv, "badger@badger.com"));
+ g_assert (tp_strv_contains (strv, "snake@badger.com"));
}
int