diff --git a/docs/reference/matrix-glib/matrix-glib-sections.txt b/docs/reference/matrix-glib/matrix-glib-sections.txt index 84eb8cf..1b794de 100644 --- a/docs/reference/matrix-glib/matrix-glib-sections.txt +++ b/docs/reference/matrix-glib/matrix-glib-sections.txt @@ -19,6 +19,10 @@ matrix_client_get_type matrix-api-types Fundamental types for MatrixAPI + +MatrixAPIError +MATRIX_API_ERROR + MatrixAPIEventFormat @@ -216,10 +220,6 @@ matrix_api_add_room_tag matrix_api_get_turn_server - -MatrixAPIError -MATRIX_API_ERROR - MatrixAPIStateEvent diff --git a/src/matrix-api-types.c b/src/matrix-api-types.c index d546da3..0c423b7 100644 --- a/src/matrix-api-types.c +++ b/src/matrix-api-types.c @@ -28,6 +28,36 @@ * communication with the homeserver. */ +/** + * MatrixAPIError: + * @MATRIX_API_ERROR_NONE: no error + * @MATRIX_API_ERROR_MISSING_TOKEN: authorization token is missing + * from the request + * @MATRIX_API_ERROR_FORBIDDEN: access was forbidden (e.g. due to a + * missing/invalid token, or using a bad + * password during login) + * @MATRIX_API_ERROR_UNKNOWN: an error unknown to the Matrix server + * @MATRIX_API_ERROR_UNKNOWN_ERROR: an error unknown to this library + * + * Value mappings from Matrix.org API error codes + * (e.g. M_MISSING_TOKEN). They should be set + * automatically by API calls, if the response contains an error code. + */ + +/** + * MATRIX_API_ERROR: + * + * Error domain for Matrix GLib SDK API. See #GError for more + * information on error domains. + */ + +/** + * matrix_api_error_quark: + * + * Gets the Matrix API error #GQuark + */ +G_DEFINE_QUARK(matrix-api-error-quark, matrix_api_error); + /** * MatrixAPIEventFormat: * @MATRIX_API_EVENT_FORMAT_DEFAULT: event format will be omitted from diff --git a/src/matrix-api-types.h b/src/matrix-api-types.h index 28c32c8..4181227 100644 --- a/src/matrix-api-types.h +++ b/src/matrix-api-types.h @@ -24,6 +24,19 @@ G_BEGIN_DECLS +typedef enum { + MATRIX_API_ERROR_NONE, + MATRIX_API_ERROR_MISSING_TOKEN, + MATRIX_API_ERROR_FORBIDDEN, + MATRIX_API_ERROR_UNKNOWN, + /* Allow for a lot of Matrix.org defined codes + Do not define error codes after this! */ + MATRIX_API_ERROR_UNKNOWN_ERROR = 16384 +} MatrixAPIError; + +#define MATRIX_API_ERROR matrix_api_error_quark() +GQuark matrix_api_error_quark(void); + typedef enum { MATRIX_API_EVENT_FORMAT_DEFAULT, MATRIX_API_EVENT_FORMAT_CLIENT, diff --git a/src/matrix-api.c b/src/matrix-api.c index b5513ec..6c9de8e 100644 --- a/src/matrix-api.c +++ b/src/matrix-api.c @@ -75,29 +75,6 @@ * A callback function to use with API calls. */ -/** - * MatrixAPIError: - * @MATRIX_API_ERROR_NONE: no error - * @MATRIX_API_ERROR_MISSING_TOKEN: authorization token is missing - * from the request - * @MATRIX_API_ERROR_FORBIDDEN: access was forbidden (e.g. due to a - * missing/invalid token, or using a bad - * password during login) - * @MATRIX_API_ERROR_UNKNOWN: an error unknown to the Matrix server - * @MATRIX_API_ERROR_UNKNOWN_ERROR: an error unknown to this library - * - * Value mappings from Matrix.org API error codes - * (e.g. M_MISSING_TOKEN). They should be set - * automatically by API calls, if the response contains an error code. - */ - -/** - * MATRIX_API_ERROR: - * - * Error domain for Matrix GLib SDK API. See #GError for more - * information on error domains. - */ - /** * MatrixAPIRoomPreset: * @MATRIX_API_ROOM_PRESET_NONE: no preset @@ -291,13 +268,6 @@ * A struct to hold a state event filter. */ -/** - * matrix_api_error_quark: - * - * Gets the Matrix API error #GQuark - */ -G_DEFINE_QUARK(matrix-api-error-quark, matrix_api_error); - G_DEFINE_INTERFACE(MatrixAPI, matrix_api, G_TYPE_OBJECT); static void diff --git a/src/matrix-api.h b/src/matrix-api.h index 17913cc..cb1db98 100644 --- a/src/matrix-api.h +++ b/src/matrix-api.h @@ -26,19 +26,6 @@ G_BEGIN_DECLS -typedef enum { - MATRIX_API_ERROR_NONE, - MATRIX_API_ERROR_MISSING_TOKEN, - MATRIX_API_ERROR_FORBIDDEN, - MATRIX_API_ERROR_UNKNOWN, - /* Allow for a lot of Matrix.org defined codes - Do not define error codes after this! */ - MATRIX_API_ERROR_UNKNOWN_ERROR = 16384 -} MatrixAPIError; - -#define MATRIX_API_ERROR matrix_api_error_quark() -GQuark matrix_api_error_quark(void); - #define MATRIX_TYPE_API (matrix_api_get_type()) #define MATRIX_API(o) (G_TYPE_CHECK_INSTANCE_CAST((o), MATRIX_TYPE_API, MatrixAPI)) #define MATRIX_IS_API(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), MATRIX_TYPE_API))