Implement get_display_name

This commit is contained in:
Gergely Polonkai 2016-01-16 14:09:59 +01:00
parent b3724498ab
commit f307f5aca2

View File

@ -2456,6 +2456,27 @@ i_set_avatar_url(MatrixAPI *api,
g_free(path);
}
static void
i_get_display_name(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/displayname", 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)
{
@ -2539,7 +2560,7 @@ matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
iface->get_profile = i_get_profile;
iface->get_avatar_url = i_get_avatar_url;
iface->set_avatar_url = i_set_avatar_url;
iface->get_display_name = NULL;
iface->get_display_name = i_get_display_name;
iface->set_display_name = NULL;
iface->register_account = NULL;
iface->set_account_data = NULL;