From 78b98b4a5c2c755e2a3d5344e56b112ea6082c54 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 3 Mar 2016 13:07:54 +0100 Subject: [PATCH] Move the Presence enum to Vala --- src/c-api.vapi | 9 --------- src/matrix-enums.vala | 12 ++++++++++++ src/matrix-types.c | 12 ------------ src/matrix-types.h | 8 -------- 4 files changed, 12 insertions(+), 29 deletions(-) diff --git a/src/c-api.vapi b/src/c-api.vapi index 6cbe674..2cfb2e4 100644 --- a/src/c-api.vapi +++ b/src/c-api.vapi @@ -41,15 +41,6 @@ namespace Matrix { public static GLib.Quark quark (); } - [CCode (cheader_filename = "matrix-enumtypes.h", cprefix = "MATRIX_PRESENCE_")] - public enum Presence { - UNKNOWN, - ONLINE, - OFFLINE, - UNAVAILABLE, - FREE_FOR_CHAT; - } - [CCode (cheader_filename = "matrix-enumtypes.h", cprefix = "MATRIX_PUSHER_KIND_")] public enum PusherKind { OVERRIDE, diff --git a/src/matrix-enums.vala b/src/matrix-enums.vala index ad0b595..ddedc68 100644 --- a/src/matrix-enums.vala +++ b/src/matrix-enums.vala @@ -43,6 +43,18 @@ namespace Matrix { FEDERATION; /// return the raw event as receieved over federation } + /** + * Presence values for matrix_api_set_user_presence() and other + * presence related queries. + */ + public enum Presence { + UNKNOWN, /// user's presence is unknown + ONLINE, /// user is online + OFFLINE, /// user is offline + UNAVAILABLE, /// user is unavailable (i.e. busy) + FREE_FOR_CHAT; /// user is free for chat + } + /** * Resizing methods for matrix_api_media_thumbnail(). */ diff --git a/src/matrix-types.c b/src/matrix-types.c index ab2c6ad..bb7451b 100644 --- a/src/matrix-types.c +++ b/src/matrix-types.c @@ -135,18 +135,6 @@ G_DEFINE_QUARK(matrix-error-quark, matrix_error); * rules. */ -/** - * MatrixPresence: - * @MATRIX_PRESENCE_UNKNOWN: user's presence is unknown - * @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. - */ - /** * MatrixPusherKind: * @MATRIX_PUSHER_KIND_OVERRIDE: highest priority rules diff --git a/src/matrix-types.h b/src/matrix-types.h index 8a225dd..ca7a5db 100644 --- a/src/matrix-types.h +++ b/src/matrix-types.h @@ -72,14 +72,6 @@ typedef enum { #define MATRIX_ERROR matrix_error_quark() GQuark matrix_error_quark(void); -typedef enum { - MATRIX_PRESENCE_UNKNOWN, - MATRIX_PRESENCE_ONLINE, - MATRIX_PRESENCE_OFFLINE, - MATRIX_PRESENCE_UNAVAILABLE, - MATRIX_PRESENCE_FREE_FOR_CHAT -} MatrixPresence; - typedef enum { MATRIX_ROOM_PRESET_NONE, MATRIX_ROOM_PRESET_PRIVATE,