Implement invite_user_3rdparty
This commit is contained in:
parent
2cb3928cf0
commit
429add0558
@ -1688,6 +1688,48 @@ i_forget_room(MatrixAPI *api,
|
||||
g_free(path);
|
||||
}
|
||||
|
||||
static void
|
||||
i_invite_user_3rdparty(MatrixAPI *api,
|
||||
MatrixAPICallback callback,
|
||||
gpointer user_data,
|
||||
const gchar *room_id,
|
||||
const gchar *address,
|
||||
const gchar *medium,
|
||||
const gchar *id_server,
|
||||
GError **error)
|
||||
{
|
||||
gchar *encoded_room_id, *path;
|
||||
JsonBuilder *builder;
|
||||
JsonNode *body;
|
||||
|
||||
encoded_room_id = soup_uri_encode(room_id, NULL);
|
||||
path = g_strdup_printf("rooms/%s/invite", encoded_room_id);
|
||||
g_free(encoded_room_id);
|
||||
|
||||
builder = json_builder_new();
|
||||
json_builder_begin_object(builder);
|
||||
|
||||
json_builder_set_member_name(builder, "id_server");
|
||||
json_builder_add_string_value(builder, id_server);
|
||||
|
||||
json_builder_set_member_name(builder, "medium");
|
||||
json_builder_add_string_value(builder, medium);
|
||||
|
||||
json_builder_set_member_name(builder, "address");
|
||||
json_builder_add_string_value(builder, address);
|
||||
|
||||
json_builder_end_object(builder);
|
||||
body = json_builder_get_root(builder);
|
||||
g_object_unref(builder);
|
||||
|
||||
_send(MATRIX_HTTP_API(api),
|
||||
callback, user_data,
|
||||
CALL_API,
|
||||
"POST", path, NULL, NULL, body, NULL,
|
||||
FALSE, error);
|
||||
g_free(path);
|
||||
}
|
||||
|
||||
static void
|
||||
matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
|
||||
{
|
||||
@ -1731,7 +1773,7 @@ matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
|
||||
/* Room membership */
|
||||
iface->ban_user = i_ban_user;
|
||||
iface->forget_room = i_forget_room;
|
||||
iface->invite_user_3rdparty = NULL;
|
||||
iface->invite_user_3rdparty = i_invite_user_3rdparty;
|
||||
iface->invite_user = NULL;
|
||||
iface->join_room = i_join_room;
|
||||
iface->leave_room = i_leave_room;
|
||||
|
Loading…
Reference in New Issue
Block a user