Top |
void | matrix_client_login_with_password () |
void | matrix_client_register_with_password () |
void | matrix_client_logout () |
void | matrix_client_begin_polling () |
void | matrix_client_stop_polling () |
void | matrix_client_emit_login_finished () |
void | matrix_client_incoming_event () |
void | matrix_client_connect_event () |
void | (*MatrixClientEventCallback) () |
void matrix_client_login_with_password (MatrixClient *self
,const gchar *username
,const gchar *password
,GError **error
);
Authenticate with the Matrix.org server with a username and password.
self |
the MatrixClient instance |
|
username |
. the username to login with . |
[in] |
password |
. the password to use . |
[in] |
error |
location to store the error occuring, or |
[error-domains MatrixError] |
void matrix_client_register_with_password (MatrixClient *self
,const gchar *username
,const gchar *password
,GError **error
);
Register username
with the homeserver as a normal user.
Upon success, the user is registered and authenticated.
Implementations must emit the login-finished signal when a response arrives.
This method registers a normal user account. If you want to register a different kind of user, use matrix_api_register_account()
.
self |
the MatrixClient instance |
|
username |
. the username to register. If omitted, the server will generate one . |
[in][allow-none] |
password |
. the password to use with the registration . |
[in] |
error |
location to store the error occuring, or |
[error-domains MatrixError] |
void matrix_client_logout (MatrixClient *self
,GError **error
);
Logout from the homeserver. As Matrix.org doesn’t have such a concept, this cancels all ongoing requests and clears the authentication data (e.g. tokens).
self |
the MatrixClient instance |
|
error |
location to store the error occuring, or |
[error-domains MatrixError] |
void matrix_client_begin_polling (MatrixClient *self
,GError **error
);
Begin polling the event stream.
self |
the MatrixClient instance |
|
error |
location to store the error occuring, or |
[error-domains MatrixError] |
void matrix_client_stop_polling (MatrixClient *self
,gboolean cancel_ongoing
,GError **error
);
Stop polling the event stream. If param
cancel_ongoing is
true
, ongoing requests will be cancelled, too.
self |
the MatrixClient instance |
|
cancel_ongoing |
. if
true
, ongoing requests will be cancelled, too . |
[in] |
error |
location to store the error occuring, or |
[error-domains MatrixError] |
void matrix_client_emit_login_finished (MatrixClient *self
,gboolean success
);
Convenience function to emits the login-finished signal.
void matrix_client_incoming_event (MatrixClient *self
,const gchar *room_id
,JsonNode *raw_event
,MatrixEvent *matrix_event
);
Emits the “event” signal.
self |
the MatrixClient instance |
|
room_id |
. the room this event is associated with . |
[in][allow-none] |
raw_event |
. the raw event . |
[in] |
matrix_event |
. the event as a Matrix.Event . |
[in] |
void matrix_client_connect_event (MatrixClient *self
,GType event_gtype
,MatrixClientEventCallback event_callback
,void *event_callback_target
,GDestroyNotify event_callback_target_destroy_notify
);
Connect a handler for events. If param
event_gtype is Matrix.Event, all events will be sent to the callback function, otherwise only events that match the specified event type.
If event_gtype
is not derived from MatrixEvent, param
callback won’t get connected.
callback |
the allback function to connect |
|
self |
the MatrixClient instance |
|
event_gtype |
. the GType of a MatrixEvent derivative . |
[in] |
event_callback_target |
user data to pass to |
[allow-none][closure] |
event_callback_target_destroy_notify |
function to call when |
[allow-none] |
event_callback |
|
void (*MatrixClientEventCallback) (MatrixClient *client
,const gchar *room_id
,JsonNode *raw_event
,MatrixEvent *matrix_event
,void *user_data
);
Callback function delegate for the event signal.
typedef struct _MatrixClient MatrixClient;
Base interface for client communication with a Matrix.org homeserver
struct MatrixClientIface { GTypeInterface parent_iface; void (*login_with_password) (MatrixClient* self, const gchar* username, const gchar* password, GError** error); void (*register_with_password) (MatrixClient* self, const gchar* username, const gchar* password, GError** error); void (*logout) (MatrixClient* self, GError** error); void (*begin_polling) (MatrixClient* self, GError** error); void (*stop_polling) (MatrixClient* self, gboolean cancel_ongoing, GError** error); void (*login_finished) (MatrixClient* self, gboolean success); void (*event) (MatrixClient* self, const gchar* room_id, JsonNode* raw_event, MatrixEvent* matrix_event); };
Interface for creating MatrixClient implementations.
GTypeInterface |
the parent interface structure |
|
virtual method called by |
||
virtual method called by |
||
virtual method called by |
||
virtual method called by |
||
virtual method called by |
||