Implement get_avatar_url

This commit is contained in:
Gergely Polonkai 2016-01-16 00:46:15 +01:00
parent fb3bfd9d70
commit 89d89d9dd3

View File

@ -2401,6 +2401,27 @@ i_get_profile(MatrixAPI *api,
g_free(path); g_free(path);
} }
static void
i_get_avatar_url(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/avatar_url", 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 static void
matrix_http_api_matrix_api_init(MatrixAPIInterface *iface) matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
{ {
@ -2482,7 +2503,7 @@ matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
iface->add_3pid = i_add_3pid; iface->add_3pid = i_add_3pid;
iface->change_password = i_change_password; iface->change_password = i_change_password;
iface->get_profile = i_get_profile; iface->get_profile = i_get_profile;
iface->get_avatar_url = NULL; iface->get_avatar_url = i_get_avatar_url;
iface->set_avatar_url = NULL; iface->set_avatar_url = NULL;
iface->get_display_name = NULL; iface->get_display_name = NULL;
iface->set_display_name = NULL; iface->set_display_name = NULL;