Port MatrixRoomMembership to C

This commit is contained in:
Gergely Polonkai 2017-11-02 09:59:24 +01:00
parent b211ee2fc2
commit 62b106511d
4 changed files with 36 additions and 42 deletions

View File

@ -171,3 +171,20 @@ G_DEFINE_QUARK(matrix-error-quark, matrix_error);
* *
* Resizing methods for matrix_api_media_thumbnail(). * Resizing methods for matrix_api_media_thumbnail().
*/ */
/**
* MatrixRoomMembership:
* @MATRIX_ROOM_MEMBERSHIP_UNKNOWN: the membership sent by the server is unknown to this SDK
* @MATRIX_ROOM_MEMBERSHIP_INVITE: the user has been invited to join a room, but has not yet
* joined it. They may not participate in the room until they join
* @MATRIX_ROOM_MEMBERSHIP_JOIN: the user has joined the room (possibly after accepting an invite),
* and may participate in it
* @MATRIX_ROOM_MEMBERSHIP_LEAVE: the user was once joined to the room, but has since left
* (possibly by choice, or possibly by being kicked)
* @MATRIX_ROOM_MEMBERSHIP_BAN: the user has been banned from the room, and is no longer allowed
* to join it until they are un-banned from the room (by having their membership state set
* to a value other than MATRIX_ROOM_MEMBERSHIP_BAN)
* @MATRIX_ROOM_MEMBERSHIP_KNOCK: this is a reserved word, which currently has no meaning
*
* Room membership types.
*/

View File

@ -124,4 +124,13 @@ typedef enum {
MATRIX_RESIZE_METHOD_SCALE MATRIX_RESIZE_METHOD_SCALE
} MatrixResizeMethod; } MatrixResizeMethod;
typedef enum {
MATRIX_ROOM_MEMBERSHIP_UNKNOWN,
MATRIX_ROOM_MEMBERSHIP_INVITE,
MATRIX_ROOM_MEMBERSHIP_JOIN,
MATRIX_ROOM_MEMBERSHIP_LEAVE,
MATRIX_ROOM_MEMBERSHIP_BAN,
MATRIX_ROOM_MEMBERSHIP_KNOCK
} MatrixRoomMembership;
#endif /* __MATRIX_TYPE_H__ */ #endif /* __MATRIX_TYPE_H__ */

View File

@ -17,48 +17,6 @@
*/ */
namespace Matrix { namespace Matrix {
/**
* Room membership types.
*/
public enum RoomMembership {
/**
* the membership sent by the server is unknown to this SDK
*/
UNKNOWN,
/**
* the user has been invited to join a room, but has not yet
* joined it. They may not participate in the room until they
* join
*/
INVITE,
/**
* the user has joined the room (possibly after accepting an
* invite), and may participate in it
*/
JOIN,
/**
* the user was once joined to the room, but has since left
* (possibly by choice, or possibly by being kicked)
*/
LEAVE,
/**
* the user has been banned from the room, and is no longer
* allowed to join it until they are un-banned from the room
* (by having their membership state set to a value other than
* {@link Matrix.RoomMembership.BAN})
*/
BAN,
/**
* this is a reserved word, which currently has no meaning
*/
KNOCK;
}
/** /**
* Preset values for matrix_api_create_room() calls. * Preset values for matrix_api_create_room() calls.
*/ */

View File

@ -122,6 +122,16 @@ namespace Matrix {
SCALE; SCALE;
} }
[CCode (cheader_filename = "matrix-enumtypes.h", cprefix = "MATRIX_ROOM_MEMBERSHIP_")]
public enum RoomMembership {
UNKNOWN,
INVITE,
JOIN,
LEAVE,
BAN,
KNOCK;
}
/** /**
* The major version number of the Matrix.org GLib SDK. * The major version number of the Matrix.org GLib SDK.
*/ */