From bace7275762c3c8a0e160a33b7b2aab8e4f4cc48 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Fri, 11 Dec 2015 00:31:15 +0100 Subject: [PATCH] Add outline of the low-level API --- src/matrix-api.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/matrix-api.h b/src/matrix-api.h index 3a4d59e..00ab55e 100644 --- a/src/matrix-api.h +++ b/src/matrix-api.h @@ -46,6 +46,60 @@ struct _MatrixAPIClass { GType matrix_api_get_type(void) G_GNUC_CONST; +void matrix_api_initial_sync(MatrixAPI *api, guint limit); +void matrix_api_set_validate_certificate(MatrixAPI *api, gboolean valid); +gboolean matrix_api_get_validate_certificate(MatrixAPI *api); +void matrix_api_register(MatrixAPI *api, gchar *login_type, ...); +void matrix_api_login(MatrixAPI *api, gchar *login_type, ...); +void matrix_api_create_room(MatrixAPI *api, + gchar *alias, + gboolean is_public, + GList *invitees); +void matrix_api_join_room(MatrixAPI *api, gchar *room_id_or_alias); +void matrix_api_event_stream(MatrixAPI *api, gchar *from_token, gulong timeout); +void matrix_api_send_state_event(MatrixAPI *api, + gchar *room_id, + gchar *event_type, + JsonNode *content, + gchar *state_key); +void matrix_api_send_message_event(MatrixAPI *api, + gchar *room_id, + gchar *event_type, + JsonNode *content, + guint txn_id); +void matrix_api_send_message(MatrixAPI *api, + gchar *room_id, + gchar *text_content, + gchar *msg_type); +void matrix_api_send_emote(MatrixAPI *api, gchar *room_id, gchar *text_content); +void matrix_api_get_room_name(MatrixAPI *api, gchar *room_id); +void matrix_api_get_room_topic(MatrixAPI *api, gchar *room_id); +void matrix_api_leave_room(MatrixAPI *api, gchar *room_id); +void matrix_api_invite_user(MatrixAPI *api, gchar *room_id, gchar *user_id); +void matrix_api_kick_user(MatrixAPI *api, + gchar *room_id, + gchar *user_id, + gchar *reason); +void matrix_api_set_membership(MatrixAPI *api, + gchar *room_id, + gchar *user_id, + gchar *membership, + gchar *reason); +void matrix_api_ban_user(MatrixAPI *api, + gchar *room_id, + gchar *user_id, + gchar *reason); +void matrix_api_get_room_state(MatrixAPI *api, gchar *room_id); +void matrix_api_get_text_body(MatrixAPI *api, gchar *text, gchar *msgtype); +void matrix_api_get_html_body(MatrixAPI *api, gchar *html, gchar *msgtype); +void matrix_api_get_emote_body(MatrixAPI *api, gchar *text); +void _send(MatrixAPI *api, + gchar *method, + gchar *path, + gchar *content, + GHashTable *query_params, + GHashTable *headers); + G_END_DECLS #endif /* __MATRIX_API_H__ */