Port MatrixJoinRules to C

This commit is contained in:
Gergely Polonkai 2017-11-02 10:13:09 +01:00
parent 6b8f2fe22c
commit 76d68d5c7b
4 changed files with 28 additions and 30 deletions

View File

@ -209,3 +209,14 @@ G_DEFINE_QUARK(matrix-error-quark, matrix_error);
*
* Visibility values for room creation. Not to be confused with join rules.
*/
/**
* MatrixJoinRules:
* @MATRIX_JOIN_RULES_UNKNOWN: a value unknown to this library
* @MATRIX_JOIN_RULES_PUBLIC: anyone can join
* @MATRIX_JOIN_RULES_INVITE: users may join upon invite
* @MATRIX_JOIN_RULES_PRIVATE: reserved word, not usable yet
* @MATRIX_JOIN_RULES_KNOCK: reserved word, not usable yet
*
* Room join rules.
*/

View File

@ -146,4 +146,12 @@ typedef enum {
MATRIX_ROOM_VISIBILITY_PRIVATE
} MatrixRoomVisibility;
typedef enum {
MATRIX_JOIN_RULES_UNKNOWN,
MATRIX_JOIN_RULES_PUBLIC,
MATRIX_JOIN_RULES_INVITE,
MATRIX_JOIN_RULES_PRIVATE,
MATRIX_JOIN_RULES_KNOCK
} MatrixJoinRules;
#endif /* __MATRIX_TYPE_H__ */

View File

@ -17,36 +17,6 @@
*/
namespace Matrix {
/**
* Room join rules.
*/
public enum JoinRules {
/**
* a value unknown to this library
*/
UNKNOWN,
/**
* anyone can join
*/
PUBLIC,
/**
* users may join upon invite
*/
INVITE,
/**
* reserved word, not usable yet
*/
PRIVATE,
/**
* reserved word, not usable yet
*/
KNOCK;
}
/**
* Search ordering.
*/

View File

@ -147,6 +147,15 @@ namespace Matrix {
PRIVATE;
}
[CCode (cheader_filename = "matrix-enumtypes.h", cprefix = "MATRIX_JOIN_RULES_")]
public enum JoinRules {
UNKNOWN,
PUBLIC,
INVITE,
PRIVATE,
KNOCK;
}
/**
* The major version number of the Matrix.org GLib SDK.
*/