From 1f0fdb79e3d7e9762591050902c93d20c529f579 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 2 Nov 2017 11:35:01 +0100 Subject: [PATCH] Port MatrixHistoryVisibility to C --- src/matrix-c-types.c | 14 ++++++++++++++ src/matrix-c-types.h | 8 ++++++++ src/matrix-types.vala | 33 --------------------------------- vapi/c-api.vapi | 9 +++++++++ 4 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/matrix-c-types.c b/src/matrix-c-types.c index ab01a63..ac7fa77 100644 --- a/src/matrix-c-types.c +++ b/src/matrix-c-types.c @@ -253,3 +253,17 @@ G_DEFINE_QUARK(matrix-error-quark, matrix_error); * event_ids that are in that group, as well as potentially other * metadata about the group. */ + +/** + * MatrixHistoryVisibility: + * @MATRIX_HISTORY_VISIBILITY_UNKNOWN: represents a value unknown to this library + * @MATRIX_HISTORY_VISIBILITY_INVITED: only room members can see the room history, and only what + * happened after they got an invitation + * @MATRIX_HISTORY_VISIBILITY_JOINED: only room members can see the room history, and only what + * happened after they joined + * @MATRIX_HISTORY_VISIBILITY_SHARED: only room members can see the room history, but they see all + * of it + * @MATRIX_HISTORY_VISIBILITY_WORLD_READABLE: anyone can see the room history + * + * Room history visibility + */ diff --git a/src/matrix-c-types.h b/src/matrix-c-types.h index ae6548e..ef57f01 100644 --- a/src/matrix-c-types.h +++ b/src/matrix-c-types.h @@ -171,4 +171,12 @@ typedef enum { MATRIX_SEARCH_GROUP_BY_SENDER } MatrixSearchGroupBy; +typedef enum { + MATRIX_HISTORY_VISIBILITY_UNKNOWN, + MATRIX_HISTORY_VISIBILITY_INVITED, + MATRIX_HISTORY_VISIBILITY_JOINED, + MATRIX_HISTORY_VISIBILITY_SHARED, + MATRIX_HISTORY_VISIBILITY_WORLD_READABLE +} MatrixHistoryVisibility; + #endif /* __MATRIX_TYPE_H__ */ diff --git a/src/matrix-types.vala b/src/matrix-types.vala index fbcafa1..15c1af3 100644 --- a/src/matrix-types.vala +++ b/src/matrix-types.vala @@ -17,39 +17,6 @@ */ namespace Matrix { - /** - * Room history visibility - */ - public enum HistoryVisibility { - /** - * represents a value unknown to this library - */ - UNKNOWN, - - /** - * only room members can see the room history, and only what - * happened after they got an invitation - */ - INVITED, - - /** - * only room members can see the room history, and only what - * happened after they joined - */ - JOINED, - - /** - * only room members can see the room history, but they see - * all of it - */ - SHARED, - - /** - * anyone can see the room history - */ - WORLD_READABLE; - } - /** * Room guest access */ diff --git a/vapi/c-api.vapi b/vapi/c-api.vapi index acece42..641dfcb 100644 --- a/vapi/c-api.vapi +++ b/vapi/c-api.vapi @@ -176,6 +176,15 @@ namespace Matrix { SENDER; } + [CCode (cheader_filename = "matrix-enumtypes.h", cprefix = "MATRIX_HISTORY_VISIBILITY_")] + public enum HistoryVisibility { + UNKNOWN, + INVITED, + JOINED, + SHARED, + WORLD_READABLE; + } + /** * The major version number of the Matrix.org GLib SDK. */