Rename enum types from MatrixAPI* to Matrix*

This commit is contained in:
Gergely Polonkai 2016-01-25 12:42:26 +01:00
parent d3ac019188
commit e163e73f2c
7 changed files with 241 additions and 256 deletions

View File

@ -26,16 +26,16 @@ MatrixError
MATRIX_ERROR
<SUBSECTION>
MatrixAPIEventFormat
MatrixAPIRoomPreset
MatrixAPIRoomVisibility
MatrixAPIResizeMethod
MatrixAPIPresence
MatrixAPIPusherKind
MatrixAPIPusherConditionKind
MatrixAPIEventDirection
MatrixAPIReceiptType
MatrixAPIAccountKind
MatrixEventFormat
MatrixRoomPreset
MatrixRoomVisibility
MatrixResizeMethod
MatrixPresence
MatrixPusherKind
MatrixPusherConditionKind
MatrixEventDirection
MatrixReceiptType
MatrixAccountKind
<SUBSECTION>
MatrixAPIFilterRules
@ -161,26 +161,26 @@ matrix_api_state_event_get_json_node
matrix_api_state_event_get_json_data
<SUBSECTION Standard>
MATRIX_TYPE_API_EVENT_FORMAT
matrix_api_event_format_get_type
MATRIX_TYPE_API_ROOM_PRESET
matrix_api_room_preset_get_type
MATRIX_TYPE_API_ROOM_VISIBILITY
matrix_api_room_visibility_get_type
MATRIX_TYPE_API_RESIZE_METHOD
matrix_api_resize_method_get_type
MATRIX_TYPE_API_PRESENCE
matrix_api_presence_get_type
MATRIX_TYPE_API_PUSHER_KIND
matrix_api_pusher_kind_get_type
MATRIX_TYPE_API_PUSHER_CONDITION_KIND
matrix_api_pusher_condition_kind_get_type
MATRIX_TYPE_API_EVENT_DIRECTION
matrix_api_event_direction_get_type
MATRIX_TYPE_API_RECEIPT_TYPE
matrix_api_receipt_type_get_type
MATRIX_TYPE_API_ACCOUNT_KIND
matrix_api_account_kind_get_type
MATRIX_TYPE_EVENT_FORMAT
matrix_event_format_get_type
MATRIX_TYPE_ROOM_PRESET
matrix_room_preset_get_type
MATRIX_TYPE_ROOM_VISIBILITY
matrix_room_visibility_get_type
MATRIX_TYPE_RESIZE_METHOD
matrix_resize_method_get_type
MATRIX_TYPE_PRESENCE
matrix_presence_get_type
MATRIX_TYPE_PUSHER_KIND
matrix_pusher_kind_get_type
MATRIX_TYPE_PUSHER_CONDITION_KIND
matrix_pusher_condition_kind_get_type
MATRIX_TYPE_EVENT_DIRECTION
matrix_event_direction_get_type
MATRIX_TYPE_RECEIPT_TYPE
matrix_receipt_type_get_type
MATRIX_TYPE_ACCOUNT_KIND
matrix_account_kind_get_type
MATRIX_TYPE_API_FILTER_RULES
matrix_api_filter_rules_get_type
MATRIX_TYPE_API_ROOM_FILTER

View File

@ -389,7 +389,7 @@ matrix_api_media_thumbnail(MatrixAPI *api,
const gchar *media_id,
guint width,
guint height,
MatrixAPIResizeMethod method,
MatrixResizeMethod method,
GError **error)
{
g_return_if_fail(MATRIX_IS_API(api));
@ -594,7 +594,7 @@ matrix_api_set_user_presence(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *user_id,
MatrixAPIPresence presence,
MatrixPresence presence,
const gchar *status_message,
GError **error)
{
@ -703,7 +703,7 @@ matrix_api_delete_pusher(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
GError **error)
{
@ -747,7 +747,7 @@ matrix_api_get_pusher(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
GError **error)
{
@ -785,7 +785,7 @@ matrix_api_get_pusher(MatrixAPI *api,
* than this rule ID
* @actions: (element-type utf8): the actions to perform when the
* conditions for this rule are met
* @conditions: (element-type MatrixAPIPusherConditionKind) (allow-none):
* @conditions: (element-type MatrixPusherConditionKind) (allow-none):
* the conditions that must hold true for an event for a
* rule to be applied. A rule with no conditions always
* matches
@ -802,7 +802,7 @@ matrix_api_add_pusher(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
const gchar *before,
const gchar *after,
@ -853,7 +853,7 @@ void matrix_api_toggle_pusher(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
gboolean enabled,
GError **error)
@ -906,11 +906,11 @@ void
matrix_api_create_room(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
MatrixAPIRoomPreset preset,
MatrixRoomPreset preset,
const gchar *room_name,
const gchar *room_alias,
const gchar *topic,
MatrixAPIRoomVisibility visibility,
MatrixRoomVisibility visibility,
JsonNode *creation_content,
GList *initial_state,
GList *invitees,
@ -1551,7 +1551,7 @@ matrix_api_list_room_messages(MatrixAPI *api,
gpointer user_data,
const gchar *room_id,
const gchar *from_token,
MatrixAPIEventDirection direction,
MatrixEventDirection direction,
guint limit,
GError **error)
{
@ -1597,7 +1597,7 @@ matrix_api_send_event_receipt(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *room_id,
MatrixAPIReceiptType receipt_type,
MatrixReceiptType receipt_type,
const gchar *event_id,
JsonNode *receipt,
GError **error)
@ -2462,7 +2462,7 @@ void
matrix_api_register_account(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
MatrixAPIAccountKind account_kind,
MatrixAccountKind account_kind,
gboolean bind_email,
const gchar *username,
const gchar *password,

View File

@ -76,7 +76,7 @@ struct _MatrixAPIInterface {
const gchar *media_id,
guint width,
guint height,
MatrixAPIResizeMethod method,
MatrixResizeMethod method,
GError **error);
void (*media_upload)(MatrixAPI *api,
MatrixAPICallback callback,
@ -107,7 +107,7 @@ struct _MatrixAPIInterface {
MatrixAPICallback callback,
gpointer user_data,
const gchar *user_id,
MatrixAPIPresence presence,
MatrixPresence presence,
const gchar *status_message,
GError **error);
@ -125,21 +125,21 @@ struct _MatrixAPIInterface {
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
GError **error);
void (*get_pusher)(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
GError **error);
void (*add_pusher)(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
const gchar *before,
const gchar *after,
@ -150,7 +150,7 @@ struct _MatrixAPIInterface {
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
gboolean enabled,
GError **error);
@ -159,11 +159,11 @@ struct _MatrixAPIInterface {
void (*create_room)(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
MatrixAPIRoomPreset preset,
MatrixRoomPreset preset,
const gchar *room_name,
const gchar *room_alias,
const gchar *topic,
MatrixAPIRoomVisibility visibility,
MatrixRoomVisibility visibility,
JsonNode *creation_content,
GList *initial_state,
GList *invitees,
@ -272,14 +272,14 @@ struct _MatrixAPIInterface {
gpointer user_data,
const gchar *room_id,
const gchar *from_token,
MatrixAPIEventDirection direction,
MatrixEventDirection direction,
guint limit,
GError **error);
void (*send_event_receipt)(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *room_id,
MatrixAPIReceiptType receipt_type,
MatrixReceiptType receipt_type,
const gchar *event_id,
JsonNode *receipt,
GError **error);
@ -423,7 +423,7 @@ struct _MatrixAPIInterface {
void (*register_account)(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
MatrixAPIAccountKind account_kind,
MatrixAccountKind account_kind,
gboolean bind_email,
const gchar *username,
const gchar *password,
@ -501,7 +501,7 @@ void matrix_api_media_thumbnail(MatrixAPI *api,
const gchar *media_id,
guint width,
guint height,
MatrixAPIResizeMethod method,
MatrixResizeMethod method,
GError **error);
void matrix_api_media_upload(MatrixAPI *api,
MatrixAPICallback callback,
@ -532,7 +532,7 @@ void matrix_api_set_user_presence(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *user_id,
MatrixAPIPresence presence,
MatrixPresence presence,
const gchar *status_message,
GError **error);
@ -550,21 +550,21 @@ void matrix_api_delete_pusher(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
GError **error);
void matrix_api_get_pusher(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
GError **error);
void matrix_api_add_pusher(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
const gchar *before,
const gchar *after,
@ -575,7 +575,7 @@ void matrix_api_toggle_pusher(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
gboolean enabled,
GError **error);
@ -584,11 +584,11 @@ void matrix_api_toggle_pusher(MatrixAPI *api,
void matrix_api_create_room(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
MatrixAPIRoomPreset preset,
MatrixRoomPreset preset,
const gchar *room_name,
const gchar *room_alias,
const gchar *topic,
MatrixAPIRoomVisibility visibility,
MatrixRoomVisibility visibility,
JsonNode *creation_content,
GList *initial_state,
GList *invitees,
@ -697,14 +697,14 @@ void matrix_api_list_room_messages(MatrixAPI *api,
gpointer user_data,
const gchar *room_id,
const gchar *from_token,
MatrixAPIEventDirection direction,
MatrixEventDirection direction,
guint limit,
GError **error);
void matrix_api_send_event_receipt(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *room_id,
MatrixAPIReceiptType receipt_type,
MatrixReceiptType receipt_type,
const gchar *event_id,
JsonNode *receipt,
GError **error);
@ -847,7 +847,7 @@ void matrix_api_set_display_name(MatrixAPI *api,
void matrix_api_register_account(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
MatrixAPIAccountKind account_kind,
MatrixAccountKind account_kind,
gboolean bind_email,
const gchar *username,
const gchar *password,

View File

@ -903,11 +903,11 @@ static void
i_create_room(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
MatrixAPIRoomPreset preset,
MatrixRoomPreset preset,
const gchar *room_name,
const gchar *room_alias,
const gchar *topic,
MatrixAPIRoomVisibility visibility,
MatrixRoomVisibility visibility,
JsonNode *creation_content,
GList *initial_state,
GList *invitees,
@ -966,9 +966,9 @@ i_create_room(MatrixAPI *api,
json_builder_add_string_value(builder, room_name);
}
if (preset != MATRIX_API_ROOM_PRESET_NONE) {
if (preset != MATRIX_ROOM_PRESET_NONE) {
gchar *preset_string = _g_enum_to_string(
MATRIX_TYPE_API_ROOM_PRESET, preset, TRUE);
MATRIX_TYPE_ROOM_PRESET, preset, TRUE);
if (preset_string) {
json_builder_set_member_name(builder, "preset");
@ -989,9 +989,9 @@ i_create_room(MatrixAPI *api,
json_builder_add_string_value(builder, topic);
}
if (visibility != MATRIX_API_ROOM_VISIBILITY_DEFAULT) {
if (visibility != MATRIX_ROOM_VISIBILITY_DEFAULT) {
gchar *visibility_string = _g_enum_to_string(
MATRIX_TYPE_API_ROOM_VISIBILITY, visibility, TRUE);
MATRIX_TYPE_ROOM_VISIBILITY, visibility, TRUE);
if (visibility_string) {
json_builder_set_member_name(builder, "visibility");
@ -1210,7 +1210,7 @@ i_media_thumbnail(MatrixAPI *api,
const gchar *media_id,
guint width,
guint height,
MatrixAPIResizeMethod method,
MatrixResizeMethod method,
GError **error)
{
gchar *encoded_server_name,
@ -1236,14 +1236,14 @@ i_media_thumbnail(MatrixAPI *api,
g_hash_table_replace(params, "height", g_strdup_printf("%u", height));
}
if (method != MATRIX_API_RESIZE_METHOD_DEFAULT) {
if (method != MATRIX_RESIZE_METHOD_DEFAULT) {
switch (method) {
case MATRIX_API_RESIZE_METHOD_CROP:
case MATRIX_RESIZE_METHOD_CROP:
g_hash_table_replace(params, "method", g_strdup("crop"));
break;
case MATRIX_API_RESIZE_METHOD_SCALE:
case MATRIX_RESIZE_METHOD_SCALE:
g_hash_table_replace(params, "method", g_strdup("scale"));
break;
@ -1325,7 +1325,7 @@ i_set_user_presence(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *user_id,
MatrixAPIPresence presence,
MatrixPresence presence,
const gchar *status_message,
GError **error)
{
@ -1344,7 +1344,7 @@ i_set_user_presence(MatrixAPI *api,
json_builder_begin_object(builder);
json_builder_set_member_name(builder, "presence");
presence_string = _g_enum_to_string(MATRIX_TYPE_API_PRESENCE, presence, TRUE);
presence_string = _g_enum_to_string(MATRIX_TYPE_PRESENCE, presence, TRUE);
json_builder_add_string_value(builder, presence_string);
g_free(presence_string);
@ -1404,7 +1404,7 @@ i_delete_pusher(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
GError **error)
{
@ -1412,7 +1412,7 @@ i_delete_pusher(MatrixAPI *api,
encoded_scope = soup_uri_encode(scope, NULL);
encoded_rule_id = soup_uri_encode(rule_id, NULL);
kind_string = _g_enum_to_string(MATRIX_TYPE_API_PUSHER_KIND, kind, TRUE);
kind_string = _g_enum_to_string(MATRIX_TYPE_PUSHER_KIND, kind, TRUE);
path = g_strdup_printf("pushrules/%s/%s/%s",
encoded_scope,
@ -1436,7 +1436,7 @@ i_get_pusher(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
GError **error)
{
@ -1444,7 +1444,7 @@ i_get_pusher(MatrixAPI *api,
encoded_scope = soup_uri_encode(scope, NULL);
encoded_rule_id = soup_uri_encode(rule_id, NULL);
kind_string = _g_enum_to_string(MATRIX_TYPE_API_PUSHER_KIND, kind, TRUE);
kind_string = _g_enum_to_string(MATRIX_TYPE_PUSHER_KIND, kind, TRUE);
path = g_strdup_printf("pushrules/%s/%s/%s",
encoded_scope,
@ -1464,11 +1464,11 @@ i_get_pusher(MatrixAPI *api,
}
static void
add_condition_kind_object(MatrixAPIPusherConditionKind kind,
add_condition_kind_object(MatrixPusherConditionKind kind,
JsonBuilder *builder)
{
gchar *kind_string = _g_enum_to_string(
MATRIX_TYPE_API_PUSHER_CONDITION_KIND, kind, TRUE);
MATRIX_TYPE_PUSHER_CONDITION_KIND, kind, TRUE);
if (!kind_string) {
g_warning("Invalid condition kind");
@ -1488,7 +1488,7 @@ static void i_add_pusher(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
const gchar *before,
const gchar *after,
@ -1503,7 +1503,7 @@ static void i_add_pusher(MatrixAPI *api,
encoded_scope = soup_uri_encode(scope, NULL);
encoded_rule_id = soup_uri_encode(rule_id, NULL);
kind_string = _g_enum_to_string(MATRIX_TYPE_API_PUSHER_KIND, kind, TRUE);
kind_string = _g_enum_to_string(MATRIX_TYPE_PUSHER_KIND, kind, TRUE);
path = g_strdup_printf("pushrules/%s/%s/%s",
encoded_scope,
@ -1556,7 +1556,7 @@ i_toggle_pusher(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *scope,
MatrixAPIPusherKind kind,
MatrixPusherKind kind,
const gchar *rule_id,
gboolean enabled,
GError **error)
@ -1567,7 +1567,7 @@ i_toggle_pusher(MatrixAPI *api,
encoded_scope = soup_uri_encode(scope, NULL);
encoded_rule_id = soup_uri_encode(rule_id, NULL);
kind_string = _g_enum_to_string(MATRIX_TYPE_API_PUSHER_KIND, kind, TRUE);
kind_string = _g_enum_to_string(MATRIX_TYPE_PUSHER_KIND, kind, TRUE);
path = g_strdup_printf("pushrules/%s/%s/%s",
encoded_scope,
@ -1898,7 +1898,7 @@ i_list_room_messages(MatrixAPI *api,
gpointer user_data,
const gchar *room_id,
const gchar *from_token,
MatrixAPIEventDirection direction,
MatrixEventDirection direction,
guint limit,
GError **error)
{
@ -1914,12 +1914,12 @@ i_list_room_messages(MatrixAPI *api,
g_hash_table_replace(params, "from", g_strdup(from_token));
switch (direction) {
case MATRIX_API_EVENT_DIRECTION_BACKWARD:
case MATRIX_EVENT_DIRECTION_BACKWARD:
g_hash_table_replace(params, "dir", g_strdup("b"));
break;
case MATRIX_API_EVENT_DIRECTION_FORWARD:
case MATRIX_EVENT_DIRECTION_FORWARD:
g_hash_table_replace(params, "dir", g_strdup("f"));
break;
@ -1942,7 +1942,7 @@ i_send_event_receipt(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *room_id,
MatrixAPIReceiptType receipt_type,
MatrixReceiptType receipt_type,
const gchar *event_id,
JsonNode *receipt,
GError **error)
@ -1951,7 +1951,7 @@ i_send_event_receipt(MatrixAPI *api,
encoded_room_id = soup_uri_encode(room_id, NULL);
encoded_event_id = soup_uri_encode(event_id, NULL);
receipt_type_string = _g_enum_to_string(MATRIX_TYPE_API_RECEIPT_TYPE,
receipt_type_string = _g_enum_to_string(MATRIX_TYPE_RECEIPT_TYPE,
receipt_type,
TRUE);
path = g_strdup_printf("rooms/%s/receipt/%s/%s",
@ -2572,7 +2572,7 @@ static void
i_register_account(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
MatrixAPIAccountKind account_kind,
MatrixAccountKind account_kind,
gboolean bind_email,
const gchar *username,
const gchar *password,
@ -2600,8 +2600,8 @@ i_register_account(MatrixAPI *api,
body = json_builder_get_root(builder);
g_object_unref(builder);
if (account_kind != MATRIX_API_ACCOUNT_KIND_DEFAULT) {
gchar *kind_string = _g_enum_to_string(MATRIX_TYPE_API_ACCOUNT_KIND,
if (account_kind != MATRIX_ACCOUNT_KIND_DEFAULT) {
gchar *kind_string = _g_enum_to_string(MATRIX_TYPE_ACCOUNT_KIND,
account_kind, TRUE);
params = create_query_params();

View File

@ -81,125 +81,111 @@
G_DEFINE_QUARK(matrix-error-quark, matrix_error);
/**
* MatrixAPIEventFormat:
* @MATRIX_API_EVENT_FORMAT_DEFAULT: event format will be omitted from
* the filter, so the server will
* use its default (usually
* @MATRIX_API_EVENT_FORMAT_FEDERATION)
* @MATRIX_API_EVENT_FORMAT_CLIENT: return the events in a format
* suitable for clients
* @MATRIX_API_EVENT_FORMAT_FEDERATION: return the raw event as
* receieved over federation
* MatrixEventFormat:
* @MATRIX_EVENT_FORMAT_DEFAULT: event format will be omitted from the
* filter, so the server will use its
* default (usually
* @MATRIX_EVENT_FORMAT_FEDERATION)
* @MATRIX_EVENT_FORMAT_CLIENT: return the events in a format suitable
* for clients
* @MATRIX_EVENT_FORMAT_FEDERATION: return the raw event as receieved
* over federation
*
* Event format received when synchronizing.
*/
/**
* MatrixAPIRoomPreset:
* @MATRIX_API_ROOM_PRESET_NONE: no preset
* @MATRIX_API_ROOM_PRESET_PRIVATE: preset for private rooms
* @MATRIX_API_ROOM_PRESET_TRUSTED_PRIVATE: same as private rooms, but
* all users get the same
* power level as the room
* creator
* @MATRIX_API_ROOM_PRESET_PUBLIC: preset for public rooms
* MatrixRoomPreset:
* @MATRIX_ROOM_PRESET_NONE: no preset
* @MATRIX_ROOM_PRESET_PRIVATE: preset for private rooms
* @MATRIX_ROOM_PRESET_TRUSTED_PRIVATE: same as private rooms, but all
* users get the same power level
* as the room creator
* @MATRIX_ROOM_PRESET_PUBLIC: preset for public rooms
*
* Preset values for matrix_api_create_room() calls.
*/
/**
* MatrixAPIRoomVisibility:
* @MATRIX_API_ROOM_VISIBILITY_DEFAULT: use a server-assigned value
* MatrixRoomVisibility:
* @MATRIX_ROOM_VISIBILITY_DEFAULT: use a server-assigned value
* (usually <code>private</code>
* @MATRIX_API_ROOM_VISIBILITY_PUBLIC: make the room visible in the
* public room list
* @MATRIX_API_ROOM_VISIBILITY_PRIVATE: hide the room from the public
* @MATRIX_ROOM_VISIBILITY_PUBLIC: make the room visible in the public
* room list
* @MATRIX_ROOM_VISIBILITY_PRIVATE: hide the room from the public room
* list
*
* Visibility values for room creation. Not to be confused with join
* rules.
*/
/**
* MatrixAPIResizeMethod:
* @MATRIX_API_RESIZE_METHOD_DEFAULT: use the server default value
* @MATRIX_API_RESIZE_METHOD_CROP: crop thumbnail to the requested
* size
* @MATRIX_API_RESIZE_METHOD_SCALE: scale thumbnail to the requested
* size
* MatrixResizeMethod:
* @MATRIX_RESIZE_METHOD_DEFAULT: use the server default value
* @MATRIX_RESIZE_METHOD_CROP: crop thumbnail to the requested size
* @MATRIX_RESIZE_METHOD_SCALE: scale thumbnail to the requested size
*
* Resizing methods for matrix_api_media_thumbnail().
*/
/**
* MatrixAPIPresence:
* @MATRIX_API_PRESENCE_ONLINE: user is online
* @MATRIX_API_PRESENCE_OFFLINE: user is offline
* @MATRIX_API_PRESENCE_UNAVAILABLE: user is unavailable (i.e. busy)
* @MATRIX_API_PRESENCE_FREE_FOR_CHAT: user is free for chat
* MatrixPresence:
* @MATRIX_PRESENCE_ONLINE: user is online
* @MATRIX_PRESENCE_OFFLINE: user is offline
* @MATRIX_PRESENCE_UNAVAILABLE: user is unavailable (i.e. busy)
* @MATRIX_PRESENCE_FREE_FOR_CHAT: user is free for chat
*
* Presence values for matrix_api_set_user_presence() and other
* presence related queries.
*/
/**
* MatrixAPIPusherKind:
* @MATRIX_API_PUSHER_KIND_OVERRIDE: highest priority rules
* @MATRIX_API_PUSHER_KIND_SENDER: for (unencrypted) messages that
* match certain patterns
* @MATRIX_API_PUSHER_KIND_ROOM: for all messages for a given
* room. The rule ID of a room rule is
* always the ID of the room that it
* affects
* @MATRIX_API_PUSHER_KIND_CONTENT: for messages from a specific
* Matrix user ID. The rule ID of
* such rules is always the Matrix ID
* of the user whose messages they'd
* apply to
* @MATRIX_API_PUSHER_KIND_UNDERRIDE: lowest priority rules
* MatrixPusherKind:
* @MATRIX_PUSHER_KIND_OVERRIDE: highest priority rules
* @MATRIX_PUSHER_KIND_SENDER: for (unencrypted) messages that match
* certain patterns
* @MATRIX_PUSHER_KIND_ROOM: for all messages for a given room. The
* rule ID of a room rule is always the ID
* of the room that it affects
* @MATRIX_PUSHER_KIND_CONTENT: for messages from a specific Matrix
* user ID. The rule ID of such rules is
* always the Matrix ID of the user whose
* messages they'd apply to
* @MATRIX_PUSHER_KIND_UNDERRIDE: lowest priority rules
*
* Pusher types.
*/
/**
* MatrixAPIPusherConditionKind:
* @MATRIX_API_PUSHER_CONDITION_KIND_EVENT_MATCH: glob pattern match
* on a field of the
* MatrixPusherConditionKind:
* @MATRIX_PUSHER_CONDITION_KIND_EVENT_MATCH: glob pattern match on a
* field of the
* event. Requires a
* <code>key</code> and
* a
* <code>key</code> and a
* <code>pattern</code>
* parameter
* @MATRIX_API_PUSHER_CONDITION_KIND_PROFILE_TAG: matches the profile
* tag of the device
* that the
* notification would
* be delivered
* to. Requires a
* @MATRIX_PUSHER_CONDITION_KIND_PROFILE_TAG: matches the profile tag
* of the device that the
* notification would be
* delivered to. Requires a
* <code>profile_tag</code>
* parameter
* @MATRIX_API_PUSHER_CONDITION_KIND_CONTAINS_DISPLAY_NAME: matches
* @MATRIX_PUSHER_CONDITION_KIND_CONTAINS_DISPLAY_NAME: matches
* unencrypted
* messages
* where the
* content's
* body
* contains
* the
* owner's
* display
* name in
* that room.
* @MATRIX_API_PUSHER_CONDITION_KIND_ROOM_MEMBER_COUNT: matches the
* current number
* of members in
* the
* room. Requires
* an
* messages where
* the content's
* body contains
* the owner's
* display name
* in that room.
* @MATRIX_PUSHER_CONDITION_KIND_ROOM_MEMBER_COUNT: matches the
* current number of
* members in the
* room. Requires an
* <code>is</code>
* parameter,
* which must be
* an integer,
* parameter, which
* must be an
* integer,
* optionally
* prefixed by
* <code>==</code>,
@ -217,29 +203,28 @@ G_DEFINE_QUARK(matrix-error-quark, matrix_error);
*/
/**
* MatrixAPIAccountKind:
* @MATRIX_API_ACCOUNT_KIND_DEFAULT: use the server default (usually
* %MATRIX_API_ACCOUNT_KIND_USER)
* @MATRIX_API_ACCOUNT_KIND_USER: normal user
* @MATRIX_API_ACCOUNT_KIND_GUEST: guest user
* MatrixAccountKind:
* @MATRIX_ACCOUNT_KIND_DEFAULT: use the server default (usually
* %MATRIX_ACCOUNT_KIND_USER)
* @MATRIX_ACCOUNT_KIND_USER: normal user
* @MATRIX_ACCOUNT_KIND_GUEST: guest user
*
* User account types.
*/
/**
* MatrixAPIEventDirection:
* @MATRIX_API_EVENT_DIRECTION_FORWARD: List events after the
* specified one
* @MATRIX_API_EVENT_DIRECTION_BACKWARD: List events before the
* specified one
* MatrixEventDirection:
* @MATRIX_EVENT_DIRECTION_FORWARD: List events after the specified
* one
* @MATRIX_EVENT_DIRECTION_BACKWARD: List events before the specified
* one
*
* Direction of events when requesting an event context.
*/
/**
* MatrixAPIReceiptType:
* @MATRIX_API_RECEIPT_TYPE_READ: indicate that the message has been
* read
* MatrixReceiptType:
* @MATRIX_RECEIPT_TYPE_READ: indicate that the message has been read
*
* Receipt types of acknowledgment.
*/
@ -1281,7 +1266,7 @@ matrix_api_room_filter_get_json_data(MatrixAPIRoomFilter *filter,
*/
struct _MatrixAPIFilter {
GList *event_fields;
MatrixAPIEventFormat event_format;
MatrixEventFormat event_format;
MatrixAPIFilterRules *presence;
MatrixAPIRoomFilter *room;
guint refcount;
@ -1453,7 +1438,7 @@ matrix_api_filter_get_event_fields(MatrixAPIFilter *filter)
*/
void
matrix_api_filter_set_event_format(MatrixAPIFilter *filter,
MatrixAPIEventFormat event_format)
MatrixEventFormat event_format)
{
filter->event_format = event_format;
}
@ -1466,7 +1451,7 @@ matrix_api_filter_set_event_format(MatrixAPIFilter *filter,
*
* Returns: the event format currently set
*/
MatrixAPIEventFormat
MatrixEventFormat
matrix_api_filter_get_event_format(MatrixAPIFilter *filter)
{
return filter->event_format;
@ -1564,7 +1549,7 @@ matrix_api_filter_get_json_node(MatrixAPIFilter *filter)
json_builder_set_member_name(builder, "event_format");
json_builder_add_string_value(builder,
_g_enum_to_string(
MATRIX_TYPE_API_EVENT_FORMAT,
MATRIX_TYPE_EVENT_FORMAT,
filter->event_format,
TRUE));

View File

@ -53,66 +53,66 @@ typedef enum {
GQuark matrix_error_quark(void);
typedef enum {
MATRIX_API_EVENT_FORMAT_DEFAULT,
MATRIX_API_EVENT_FORMAT_CLIENT,
MATRIX_API_EVENT_FORMAT_FEDERATION
} MatrixAPIEventFormat;
MATRIX_EVENT_FORMAT_DEFAULT,
MATRIX_EVENT_FORMAT_CLIENT,
MATRIX_EVENT_FORMAT_FEDERATION
} MatrixEventFormat;
typedef enum {
MATRIX_API_RESIZE_METHOD_DEFAULT,
MATRIX_API_RESIZE_METHOD_CROP,
MATRIX_API_RESIZE_METHOD_SCALE
} MatrixAPIResizeMethod;
MATRIX_RESIZE_METHOD_DEFAULT,
MATRIX_RESIZE_METHOD_CROP,
MATRIX_RESIZE_METHOD_SCALE
} MatrixResizeMethod;
typedef enum {
MATRIX_API_PRESENCE_ONLINE,
MATRIX_API_PRESENCE_OFFLINE,
MATRIX_API_PRESENCE_UNAVAILABLE,
MATRIX_API_PRESENCE_FREE_FOR_CHAT
} MatrixAPIPresence;
MATRIX_PRESENCE_ONLINE,
MATRIX_PRESENCE_OFFLINE,
MATRIX_PRESENCE_UNAVAILABLE,
MATRIX_PRESENCE_FREE_FOR_CHAT
} MatrixPresence;
typedef enum {
MATRIX_API_ROOM_PRESET_NONE,
MATRIX_API_ROOM_PRESET_PRIVATE,
MATRIX_API_ROOM_PRESET_TRUSTED_PRIVATE,
MATRIX_API_ROOM_PRESET_PUBLIC
} MatrixAPIRoomPreset;
MATRIX_ROOM_PRESET_NONE,
MATRIX_ROOM_PRESET_PRIVATE,
MATRIX_ROOM_PRESET_TRUSTED_PRIVATE,
MATRIX_ROOM_PRESET_PUBLIC
} MatrixRoomPreset;
typedef enum {
MATRIX_API_ROOM_VISIBILITY_DEFAULT,
MATRIX_API_ROOM_VISIBILITY_PUBLIC,
MATRIX_API_ROOM_VISIBILITY_PRIVATE
} MatrixAPIRoomVisibility;
MATRIX_ROOM_VISIBILITY_DEFAULT,
MATRIX_ROOM_VISIBILITY_PUBLIC,
MATRIX_ROOM_VISIBILITY_PRIVATE
} MatrixRoomVisibility;
typedef enum {
MATRIX_API_EVENT_DIRECTION_FORWARD,
MATRIX_API_EVENT_DIRECTION_BACKWARD
} MatrixAPIEventDirection;
MATRIX_EVENT_DIRECTION_FORWARD,
MATRIX_EVENT_DIRECTION_BACKWARD
} MatrixEventDirection;
typedef enum {
MATRIX_API_RECEIPT_TYPE_READ
} MatrixAPIReceiptType;
MATRIX_RECEIPT_TYPE_READ
} MatrixReceiptType;
typedef enum {
MATRIX_API_PUSHER_KIND_OVERRIDE,
MATRIX_API_PUSHER_KIND_SENDER,
MATRIX_API_PUSHER_KIND_ROOM,
MATRIX_API_PUSHER_KIND_CONTENT,
MATRIX_API_PUSHER_KIND_UNDERRIDE
} MatrixAPIPusherKind;
MATRIX_PUSHER_KIND_OVERRIDE,
MATRIX_PUSHER_KIND_SENDER,
MATRIX_PUSHER_KIND_ROOM,
MATRIX_PUSHER_KIND_CONTENT,
MATRIX_PUSHER_KIND_UNDERRIDE
} MatrixPusherKind;
typedef enum {
MATRIX_API_PUSHER_CONDITION_KIND_EVENT_MATCH,
MATRIX_API_PUSHER_CONDITION_KIND_PROFILE_TAG,
MATRIX_API_PUSHER_CONDITION_KIND_CONTAINS_DISPLAY_NAME,
MATRIX_API_PUSHER_CONDITION_KIND_ROOM_MEMBER_COUNT
} MatrixAPIPusherConditionKind;
MATRIX_PUSHER_CONDITION_KIND_EVENT_MATCH,
MATRIX_PUSHER_CONDITION_KIND_PROFILE_TAG,
MATRIX_PUSHER_CONDITION_KIND_CONTAINS_DISPLAY_NAME,
MATRIX_PUSHER_CONDITION_KIND_ROOM_MEMBER_COUNT
} MatrixPusherConditionKind;
typedef enum {
MATRIX_API_ACCOUNT_KIND_DEFAULT,
MATRIX_API_ACCOUNT_KIND_USER,
MATRIX_API_ACCOUNT_KIND_GUEST
} MatrixAPIAccountKind;
MATRIX_ACCOUNT_KIND_DEFAULT,
MATRIX_ACCOUNT_KIND_USER,
MATRIX_ACCOUNT_KIND_GUEST
} MatrixAccountKind;
typedef struct _MatrixAPIFilterRules MatrixAPIFilterRules;
@ -211,8 +211,8 @@ void matrix_api_filter_delete_event_field(MatrixAPIFilter *filter,
const gchar *event_field);
const GList *matrix_api_filter_get_event_fields(MatrixAPIFilter *filter);
void matrix_api_filter_set_event_format(MatrixAPIFilter *filter,
MatrixAPIEventFormat event_format);
MatrixAPIEventFormat matrix_api_filter_get_event_format(MatrixAPIFilter *filter);
MatrixEventFormat event_format);
MatrixEventFormat matrix_api_filter_get_event_format(MatrixAPIFilter *filter);
void matrix_api_filter_set_presence_filter(MatrixAPIFilter *filter,
MatrixAPIFilterRules *presence_filter);
MatrixAPIFilterRules *matrix_api_filter_get_presence_filter(MatrixAPIFilter *filter);

View File

@ -137,10 +137,10 @@ login_finished(MatrixAPI *api,
NULL);
matrix_api_create_room(api,
create_room_finished, NULL,
MATRIX_API_ROOM_PRESET_PUBLIC,
MATRIX_ROOM_PRESET_PUBLIC,
"GLib SDK test room", "matrix-glib-sdk-test",
"GLib SDK test room",
MATRIX_API_ROOM_VISIBILITY_DEFAULT,
MATRIX_ROOM_VISIBILITY_DEFAULT,
NULL, NULL, NULL, NULL, NULL);
matrix_api_get_presence_list(api, NULL, NULL, user_id, NULL);
matrix_api_get_user_presence(api,