Port MatrixPresence to C

This commit is contained in:
Gergely Polonkai 2017-11-02 09:36:06 +01:00
parent 25f809d37e
commit f97896a250
4 changed files with 28 additions and 31 deletions

View File

@ -116,3 +116,14 @@ G_DEFINE_QUARK(matrix-error-quark, matrix_error);
*
* Event format received when synchronizing.
*/
/**
* MatrixPresence:
* @MATRIX_PRESENCE_UNKNOWN: user's presence is unknown
* @MATRIX_PRESENCE_ONLINE: user is online
* @MATRIX_PRESENCE_OFFLINE: user is offline
* @MATRIX_PRESENCE_UNAVAILABLE: user is unavailable (i.e. busy)
* @MATRIX_PRESENCE_FREE_FOR_CHAT: user is free for chat
*
* Presence values for matrix_api_set_presence() and other presence related queries.
*/

View File

@ -91,4 +91,12 @@ typedef enum {
MATRIX_EVENT_FORMAT_FEDERATION
} MatrixEventFormat;
typedef enum {
MATRIX_PRESENCE_UNKNOWN,
MATRIX_PRESENCE_ONLINE,
MATRIX_PRESENCE_OFFLINE,
MATRIX_PRESENCE_UNAVAILABLE,
MATRIX_PRESENCE_FREE_FOR_CHAT
} MatrixPresence;
#endif /* __MATRIX_TYPE_H__ */

View File

@ -17,37 +17,6 @@
*/
namespace Matrix {
/**
* Presence values for matrix_api_set_user_presence() and other
* presence related queries.
*/
public enum Presence {
/**
* user's presence is unknown
*/
UNKNOWN,
/**
* user is online
*/
ONLINE,
/**
* user is offline
*/
OFFLINE,
/**
* user is unavailable (i.e. busy)
*/
UNAVAILABLE,
/**
* user is free for chat
*/
FREE_FOR_CHAT;
}
/**
* Condition types for pushers.
*/

View File

@ -84,6 +84,15 @@ namespace Matrix {
FEDERATION;
}
[CCode (cheader_filename = "matrix-enumtypes.h", cprefix = "MATRIX_PRESENCE_")]
public enum Presence {
UNKNOWN,
ONLINE,
OFFLINE,
UNAVAILABLE,
FREE_FOR_CHAT;
}
/**
* The major version number of the Matrix.org GLib SDK.
*/