aboutsummaryrefslogtreecommitdiffstats
path: root/facebook/facebook-api.h
diff options
context:
space:
mode:
authorjgeboski <jgeboski@gmail.com>2015-01-14 20:21:25 -0500
committerjgeboski <jgeboski@gmail.com>2015-01-14 22:02:57 -0500
commit0bcca046b3d946ef173a7a40be0e530978993dc4 (patch)
tree2c7d00d775380b3a3d6ecea58a6386bf3baa778b /facebook/facebook-api.h
parent3f9da0c8ea2b785ba33df99fff7147e3db575a5d (diff)
downloadbitlbee-facebook-0bcca046b3d946ef173a7a40be0e530978993dc4.tar.gz
bitlbee-facebook-0bcca046b3d946ef173a7a40be0e530978993dc4.tar.bz2
bitlbee-facebook-0bcca046b3d946ef173a7a40be0e530978993dc4.tar.xz
Implemented presence states of contacts
Diffstat (limited to 'facebook/facebook-api.h')
-rw-r--r--facebook/facebook-api.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/facebook/facebook-api.h b/facebook/facebook-api.h
index 5c84967..bbdd860 100644
--- a/facebook/facebook-api.h
+++ b/facebook/facebook-api.h
@@ -79,6 +79,9 @@ typedef struct fb_api_funcs fb_api_funcs_t;
/** The structure for representing an #fb_api message. **/
typedef struct fb_api_msg fb_api_msg_t;
+/** The structure for representing an #fb_api presence. **/
+typedef struct fb_api_pres fb_api_pres_t;
+
/** The structure for representing an #fb_api user. **/
typedef struct fb_api_user fb_api_user_t;
@@ -146,6 +149,16 @@ struct fb_api_funcs
* @param data The user-defined data or NULL.
**/
void (*message) (fb_api_t *api, const GSList *msgs, gpointer data);
+
+ /**
+ * The presence function. This is called whenever the #fb_api has
+ * retrieved a presence update.
+ *
+ * @param api The #fb_api.
+ * @param press The #GSList of #fb_api_pres.
+ * @param data The user-defined data or NULL.
+ **/
+ void (*presence) (fb_api_t *api, const GSList *press, gpointer data);
};
/**
@@ -178,6 +191,15 @@ struct fb_api_msg
};
/**
+ * The structure for representing an #fb_api presence.
+ **/
+struct fb_api_pres
+{
+ gchar *uid; /** The user identifier. **/
+ gboolean active; /** TRUE if the user is active. **/
+};
+
+/**
* The structure for representing an #fb_api user.
**/
struct fb_api_user
@@ -215,6 +237,10 @@ fb_api_msg_t *fb_api_msg_new(const gchar *uid, const gchar *text);
void fb_api_msg_free(fb_api_msg_t *msg);
+fb_api_pres_t *fb_api_pres_new(const gchar *uid, gboolean online);
+
+void fb_api_pres_free(fb_api_pres_t *pres);
+
fb_api_user_t *fb_api_user_new(const gchar *uid, const gchar *name);
void fb_api_user_free(fb_api_user_t *user);