From 6b8f2fe22cac06a8d661936723214c6e84c63bde Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 2 Nov 2017 10:09:18 +0100 Subject: [PATCH] Port MatrixRoomVisibility to C --- src/matrix-c-types.c | 10 ++++++++++ src/matrix-c-types.h | 6 ++++++ src/matrix-types.vala | 22 ---------------------- vapi/c-api.vapi | 7 +++++++ 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/matrix-c-types.c b/src/matrix-c-types.c index 99aaf46..20ebba0 100644 --- a/src/matrix-c-types.c +++ b/src/matrix-c-types.c @@ -199,3 +199,13 @@ G_DEFINE_QUARK(matrix-error-quark, matrix_error); * * Preset values for matrix_api_create_room() calls. */ + +/** + * MatrixRoomVisibility: + * @MATRIX_ROOM_VISIBILITY_DEFAULT: use a server-assigned value (usually + * #MATRIX_ROOM_VISIBILITY_PRIVATE) + * @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. + */ diff --git a/src/matrix-c-types.h b/src/matrix-c-types.h index cd8c75e..321a592 100644 --- a/src/matrix-c-types.h +++ b/src/matrix-c-types.h @@ -140,4 +140,10 @@ typedef enum { MATRIX_ROOM_PRESET_PUBLIC } MatrixRoomPreset; +typedef enum { + MATRIX_ROOM_VISIBILITY_DEFAULT, + MATRIX_ROOM_VISIBILITY_PUBLIC, + MATRIX_ROOM_VISIBILITY_PRIVATE +} MatrixRoomVisibility; + #endif /* __MATRIX_TYPE_H__ */ diff --git a/src/matrix-types.vala b/src/matrix-types.vala index 0ced692..497da3b 100644 --- a/src/matrix-types.vala +++ b/src/matrix-types.vala @@ -17,28 +17,6 @@ */ namespace Matrix { - /** - * Visibility values for room creation. Not to be confused with - * join rules. - */ - public enum RoomVisibility { - /** - * use a server-assigned value (usually - * {@link Matrix.RoomVisibility.PRIVATE}) - */ - DEFAULT, - - /** - * make the room visible in the public room list - */ - PUBLIC, - - /** - * hide the room from the public room list - */ - PRIVATE; - } - /** * Room join rules. */ diff --git a/vapi/c-api.vapi b/vapi/c-api.vapi index b60e8b1..1fb6d0d 100644 --- a/vapi/c-api.vapi +++ b/vapi/c-api.vapi @@ -140,6 +140,13 @@ namespace Matrix { PUBLIC; } + [CCode (cheader_filename = "matrix-enumtypes.h", cprefix = "MATRIX_ROOM_VISIBILITY_")] + public enum RoomVisibility { + DEFAULT, + PUBLIC, + PRIVATE; + } + /** * The major version number of the Matrix.org GLib SDK. */