Implement get_profile

This commit is contained in:
Gergely Polonkai 2016-01-15 20:43:55 +01:00
parent 02518c495b
commit fb3bfd9d70

View File

@ -2380,6 +2380,27 @@ i_change_password(MatrixAPI *api,
FALSE, error);
}
static void
i_get_profile(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *user_id,
GError **error)
{
gchar *encoded_user_id, *path;
encoded_user_id = soup_uri_encode(user_id, NULL);
path = g_strdup_printf("profile/%s", encoded_user_id);
g_free(encoded_user_id);
_send(MATRIX_HTTP_API(api),
callback, user_data,
CALL_API,
"GET", path, NULL, NULL, NULL, NULL,
FALSE, error);
g_free(path);
}
static void
matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
{
@ -2460,7 +2481,7 @@ matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
iface->get_3pids = i_get_3pids;
iface->add_3pid = i_add_3pid;
iface->change_password = i_change_password;
iface->get_profile = NULL;
iface->get_profile = i_get_profile;
iface->get_avatar_url = NULL;
iface->set_avatar_url = NULL;
iface->get_display_name = NULL;