Update MatrixAPI with the versions API call

This commit is contained in:
Gergely Polonkai 2016-01-15 19:21:33 +01:00
parent c2593c6cd0
commit 13c8707dbf
3 changed files with 33 additions and 0 deletions

View File

@ -83,6 +83,7 @@
* @create_filter: virtual function for matrix_api_create_filter() * @create_filter: virtual function for matrix_api_create_filter()
* @download_filter: virtual function for matrix_api_download_filter() * @download_filter: virtual function for matrix_api_download_filter()
* @whois: virtual function for matrix_api_whois() * @whois: virtual function for matrix_api_whois()
* @versions: virtual function for matrix_api_versions()
* @login: virtual function for matrix_api_login() * @login: virtual function for matrix_api_login()
* @token_refresh: virtual function for matrix_api_token_refresh() * @token_refresh: virtual function for matrix_api_token_refresh()
* @get_3pids: virtual function for matrix_api_get_3pids() * @get_3pids: virtual function for matrix_api_get_3pids()
@ -1646,6 +1647,29 @@ matrix_api_whois(MatrixAPI *api,
->whois(api, callback, user_data, user_id, error); ->whois(api, callback, user_data, user_id, error);
} }
/**
* matrix_api_versions:
* @api: a #MatrixAPI iplementation
* @callback: (scope async): the function to call when the request is
* finished
* @user_data: (closure): user data to pass to the callback function
* @callback
* @error: return location for a #GError, or %NULL
*
* Get the versions of the specification supported by the server.
*/
void
matrix_api_versions(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
GError **error)
{
g_return_if_fail(MATRIX_IS_API(api));
MATRIX_API_GET_IFACE(api)
->versions(api, callback, user_data, error);
}
/* Session management */ /* Session management */
/** /**

View File

@ -358,6 +358,10 @@ struct _MatrixAPIInterface {
gpointer user_data, gpointer user_data,
const gchar *user_id, const gchar *user_id,
GError **error); GError **error);
void (*versions)(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
GError **error);
/* Session management */ /* Session management */
@ -774,6 +778,10 @@ void matrix_api_whois(MatrixAPI *api,
gpointer user_data, gpointer user_data,
const gchar *user_id, const gchar *user_id,
GError **error); GError **error);
void matrix_api_versions(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
GError **error);
/* Session management */ /* Session management */

View File

@ -2246,6 +2246,7 @@ matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
/* Server administration */ /* Server administration */
iface->whois = NULL; iface->whois = NULL;
iface->versions = NULL;
/* Session management */ /* Session management */
iface->login = i_login; iface->login = i_login;