Implement add_room_tag
This commit is contained in:
parent
2dfdb754f3
commit
b5c569be55
@ -2649,6 +2649,35 @@ i_delete_room_tag(MatrixAPI *api,
|
||||
g_free(path);
|
||||
}
|
||||
|
||||
static void
|
||||
i_add_room_tag(MatrixAPI *api,
|
||||
MatrixAPICallback callback,
|
||||
gpointer user_data,
|
||||
const gchar *user_id,
|
||||
const gchar *room_id,
|
||||
const gchar *tag,
|
||||
JsonNode *content,
|
||||
GError **error)
|
||||
{
|
||||
gchar *encoded_user_id, *encoded_room_id, *encoded_tag, *path;
|
||||
|
||||
encoded_user_id = soup_uri_encode(user_id, NULL);
|
||||
encoded_room_id = soup_uri_encode(room_id, NULL);
|
||||
encoded_tag = soup_uri_encode(tag, NULL);
|
||||
path = g_strdup_printf("user/%s/rooms/%s/tags/%s",
|
||||
encoded_user_id, encoded_room_id, encoded_tag);
|
||||
g_free(encoded_user_id);
|
||||
g_free(encoded_room_id);
|
||||
g_free(encoded_tag);
|
||||
|
||||
_send(MATRIX_HTTP_API(api),
|
||||
callback, user_data,
|
||||
CALL_API,
|
||||
"PUT", path, NULL, NULL, content, NULL,
|
||||
FALSE, error);
|
||||
g_free(path);
|
||||
}
|
||||
|
||||
static void
|
||||
matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
|
||||
{
|
||||
@ -2738,7 +2767,7 @@ matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
|
||||
iface->set_account_data = i_set_account_data;
|
||||
iface->get_room_tags = i_get_room_tags;
|
||||
iface->delete_room_tag = i_delete_room_tag;
|
||||
iface->add_room_tag = NULL;
|
||||
iface->add_room_tag = i_add_room_tag;
|
||||
|
||||
/* VoIP */
|
||||
iface->get_turn_server = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user