WIP: Add API methods for listing and fetching devices
This commit is contained in:
parent
429b1711cd
commit
4f630186d7
@ -74,6 +74,8 @@ matrix_api_get_turn_server
|
|||||||
matrix_api_media_download
|
matrix_api_media_download
|
||||||
matrix_api_media_thumbnail
|
matrix_api_media_thumbnail
|
||||||
matrix_api_media_upload
|
matrix_api_media_upload
|
||||||
|
matrix_api_get_devices
|
||||||
|
matrix_api_get_device
|
||||||
matrix_api_get_token
|
matrix_api_get_token
|
||||||
matrix_api_set_token
|
matrix_api_set_token
|
||||||
matrix_api_get_user_id
|
matrix_api_get_user_id
|
||||||
|
@ -102,6 +102,8 @@
|
|||||||
* @media_download: the virtual function pointer to matrix_api_media_download()
|
* @media_download: the virtual function pointer to matrix_api_media_download()
|
||||||
* @media_thumbnail: the virtual function pointer to matrix_api_media_thumbnail()
|
* @media_thumbnail: the virtual function pointer to matrix_api_media_thumbnail()
|
||||||
* @media_upload: the virtual function pointer to matrix_api_media_upload()
|
* @media_upload: the virtual function pointer to matrix_api_media_upload()
|
||||||
|
* @get_devices: the virtual function pointer to matrix_api_get_devices()
|
||||||
|
* @get_device: the virtual function pointer to matrix_api_get_device()
|
||||||
* @get_token: the virtual function pointer to matrix_api_get_token()
|
* @get_token: the virtual function pointer to matrix_api_get_token()
|
||||||
* @set_token: the virtual function pointer to matrix_api_set_token()
|
* @set_token: the virtual function pointer to matrix_api_set_token()
|
||||||
* @get_user_id: the virtual function pointer to matrix_api_get_user_id()
|
* @get_user_id: the virtual function pointer to matrix_api_get_user_id()
|
||||||
@ -1975,6 +1977,49 @@ matrix_api_media_upload(MatrixAPI *matrix_api,
|
|||||||
MATRIX_API_GET_IFACE(matrix_api)->media_upload(matrix_api, callback, user_data, content_type, content, error);
|
MATRIX_API_GET_IFACE(matrix_api)->media_upload(matrix_api, callback, user_data, content_type, content, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* matrix_api_get_devices:
|
||||||
|
* @api: a #MatrixAPI
|
||||||
|
* @callback: a function to call when the request is finished
|
||||||
|
* @user_data: user data to be passed to @callback
|
||||||
|
* @error: (nullable): a #GError, or %NULL to ignore errors
|
||||||
|
*
|
||||||
|
* Get the list of devices for the current user.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
matrix_api_get_devices(MatrixAPI *api,
|
||||||
|
MatrixAPICallback callback,
|
||||||
|
gpointer user_data,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
g_return_if_fail(api != NULL);
|
||||||
|
|
||||||
|
MATRIX_API_GET_IFACE(api)->get_devices(api, callback, user_data, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* matrix_api_get_device:
|
||||||
|
* @api: a #MatrixAPI
|
||||||
|
* @device_id: a device ID
|
||||||
|
* @callback: a function to call when the request is finished
|
||||||
|
* @user_data: user data to be passed to @callback
|
||||||
|
* @error: (nullable): a #GError, or %NULL to ignore errors
|
||||||
|
*
|
||||||
|
* Get the details of the given device.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
matrix_api_get_device(MatrixAPI *api,
|
||||||
|
const gchar *device_id,
|
||||||
|
MatrixAPICallback callback,
|
||||||
|
gpointer user_data,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
g_return_if_fail(api != NULL);
|
||||||
|
g_return_if_fail(device_id != NULL);
|
||||||
|
|
||||||
|
MATRIX_API_GET_IFACE(api)->get_device(api, device_id, callback, user_data, error);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* matrix_api_get_token:
|
* matrix_api_get_token:
|
||||||
* @api: a #MatrixAPI
|
* @api: a #MatrixAPI
|
||||||
|
@ -476,6 +476,15 @@ struct _MatrixAPIInterface {
|
|||||||
const gchar *content_type,
|
const gchar *content_type,
|
||||||
GByteArray *content,
|
GByteArray *content,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
void (*get_devices)(MatrixAPI *api,
|
||||||
|
MatrixAPICallback callback,
|
||||||
|
gpointer user_data,
|
||||||
|
GError **error);
|
||||||
|
void (*get_device)(MatrixAPI *api,
|
||||||
|
const gchar *device_id,
|
||||||
|
MatrixAPICallback callback,
|
||||||
|
gpointer user_data,
|
||||||
|
GError **error);
|
||||||
const gchar *(*get_token)(MatrixAPI *api);
|
const gchar *(*get_token)(MatrixAPI *api);
|
||||||
void (*set_token)(MatrixAPI *api, const gchar *value);
|
void (*set_token)(MatrixAPI *api, const gchar *value);
|
||||||
const gchar *(*get_user_id)(MatrixAPI *api);
|
const gchar *(*get_user_id)(MatrixAPI *api);
|
||||||
@ -920,6 +929,15 @@ void matrix_api_media_upload(MatrixAPI *api,
|
|||||||
MatrixAPICallback callback,
|
MatrixAPICallback callback,
|
||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
void matrix_api_get_devices(MatrixAPI *api,
|
||||||
|
MatrixAPICallback callback,
|
||||||
|
gpointer user_data,
|
||||||
|
GError **error);
|
||||||
|
void matrix_api_get_device(MatrixAPI *api,
|
||||||
|
const gchar *device_id,
|
||||||
|
MatrixAPICallback callback,
|
||||||
|
gpointer user_data,
|
||||||
|
GError **error);
|
||||||
const gchar *matrix_api_get_token(MatrixAPI *api);
|
const gchar *matrix_api_get_token(MatrixAPI *api);
|
||||||
void matrix_api_set_token(MatrixAPI *api, const gchar *token);
|
void matrix_api_set_token(MatrixAPI *api, const gchar *token);
|
||||||
const gchar *matrix_api_get_user_id(MatrixAPI *api);
|
const gchar *matrix_api_get_user_id(MatrixAPI *api);
|
||||||
|
Loading…
Reference in New Issue
Block a user