From c8fe8e1ebb121c11bb468e5feb63742139fe1b26 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 2 Nov 2017 09:47:59 +0100 Subject: [PATCH] Port MatrixPusherKind to C --- src/matrix-c-types.c | 13 +++++++++++++ src/matrix-c-types.h | 8 ++++++++ src/matrix-types.vala | 33 --------------------------------- vapi/c-api.vapi | 9 +++++++++ 4 files changed, 30 insertions(+), 33 deletions(-) diff --git a/src/matrix-c-types.c b/src/matrix-c-types.c index 0451147..4e822e9 100644 --- a/src/matrix-c-types.c +++ b/src/matrix-c-types.c @@ -142,3 +142,16 @@ G_DEFINE_QUARK(matrix-error-quark, matrix_error); * * Condition types for pushers. */ + +/** + * 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. + */ diff --git a/src/matrix-c-types.h b/src/matrix-c-types.h index 8a1d564..9642522 100644 --- a/src/matrix-c-types.h +++ b/src/matrix-c-types.h @@ -106,4 +106,12 @@ typedef enum { MATRIX_PUSHER_CONDITION_KIND_ROOM_MEMBER_COUNT } MatrixPusherConditionKind; +typedef enum { + MATRIX_PUSHER_KIND_OVERRIDE, + MATRIX_PUSHER_KIND_SENDER, + MATRIX_PUSHER_KIND_ROOM, + MATRIX_PUSHER_KIND_CONTENT, + MATRIX_PUSHER_KIND_UNDERRIDE +} MatrixPusherKind; + #endif /* __MATRIX_TYPE_H__ */ diff --git a/src/matrix-types.vala b/src/matrix-types.vala index 03d475d..fda2e1c 100644 --- a/src/matrix-types.vala +++ b/src/matrix-types.vala @@ -17,39 +17,6 @@ */ namespace Matrix { - /** - * Pusher types. - */ - public enum PusherKind { - /** - * highest priority rules - */ - OVERRIDE, - - /** - * for (unencrypted) messages that match certain patterns - */ - SENDER, - - /** - * for all messages for a given room. The rule ID of a room - * rule is always the ID of the room that it affects - */ - ROOM, - - /** - * 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 - */ - CONTENT, - - /** - * lowest priority rules - */ - UNDERRIDE; - } - /** * Receipt types of acknowledgment. */ diff --git a/vapi/c-api.vapi b/vapi/c-api.vapi index 47d3a5e..b7ea719 100644 --- a/vapi/c-api.vapi +++ b/vapi/c-api.vapi @@ -101,6 +101,15 @@ namespace Matrix { ROOM_MEMBER_COUNT; } + [CCode (cheader_filename = "matrix-enumtypes.h", cprefix = "MATRIX_PUSHER_KIND_")] + public enum PusherKind { + OVERRIDE, + SENDER, + ROOM, + CONTENT, + UNDERRIDE; + } + /** * The major version number of the Matrix.org GLib SDK. */