diff options
author | jgeboski <jgeboski@gmail.com> | 2015-01-03 18:51:42 -0500 |
---|---|---|
committer | jgeboski <jgeboski@gmail.com> | 2015-01-14 16:06:05 -0500 |
commit | 20cd31cc5e1320e7dde8a30380d67185c5b289c8 (patch) | |
tree | 4e428a88daa25093bf156766405e8d932ab8844d /facebook/facebook-api.h | |
parent | cefcc09b3a91f882a4511f675750d1798494969b (diff) | |
download | bitlbee-facebook-20cd31cc5e1320e7dde8a30380d67185c5b289c8.tar.gz bitlbee-facebook-20cd31cc5e1320e7dde8a30380d67185c5b289c8.tar.bz2 bitlbee-facebook-20cd31cc5e1320e7dde8a30380d67185c5b289c8.tar.xz |
Implemented contacts list lookup
Diffstat (limited to 'facebook/facebook-api.h')
-rw-r--r-- | facebook/facebook-api.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/facebook/facebook-api.h b/facebook/facebook-api.h index 7d61c8e..b6bd8bd 100644 --- a/facebook/facebook-api.h +++ b/facebook/facebook-api.h @@ -28,11 +28,15 @@ #define FB_API_HOST "api.facebook.com" #define FB_API_BHOST "b-api.facebook.com" +#define FB_API_GHOST "graph.facebook.com" #define FB_API_AGENT "Facebook App / " PACKAGE " / " PACKAGE_VERSION #define FB_API_KEY "256002347743983" #define FB_API_SECRET "374e60f8b9bb6b8cbb30f78030438895" #define FB_API_PATH_AUTH "/method/auth.login" +#define FB_API_PATH_GQL "/graphql" + +#define FB_API_QRYID_CONTACTS "10153122424521729" /** @@ -59,6 +63,9 @@ typedef struct fb_api fb_api_t; /** The main structure for #fb_api callback functions. **/ typedef struct fb_api_funcs fb_api_funcs_t; +/** The structure for representing an #fb_api user. **/ +typedef struct fb_api_user fb_api_user_t; + /** * The #GError codes of #fb_api. @@ -102,6 +109,17 @@ struct fb_api_funcs * @param data The user-defined data or NULL. **/ void (*connect) (fb_api_t *api, gpointer data); + + /** + * The contacts function. This is called whenever the #fb_api has + * retrieved a set contacts. This is called as a result of + * #fb_api_contacts(). + * + * @param api The #fb_api. + * @param users The #GSList of #fb_api_user. + * @param data The user-defined data or NULL. + **/ + void (*contacts) (fb_api_t *api, const GSList *users, gpointer data); }; /** @@ -124,6 +142,15 @@ struct fb_api gchar *sid; /** The sync identifier. **/ }; +/** + * The structure for representing an #fb_api user. + **/ +struct fb_api_user +{ + gchar *uid; /** The user identifier. **/ + gchar *name; /** The name of the user. **/ +}; + #define FB_API_ERROR fb_api_error_quark() @@ -139,8 +166,14 @@ void fb_api_error(fb_api_t *api, fb_api_error_t err, const gchar *fmt, ...); void fb_api_auth(fb_api_t *api, const gchar *user, const gchar *pass); +void fb_api_contacts(fb_api_t *api); + void fb_api_connect(fb_api_t *api); void fb_api_disconnect(fb_api_t *api); +fb_api_user_t *fb_api_user_new(const gchar *uid, const gchar *name); + +void fb_api_user_free(fb_api_user_t *user); + #endif /* _FACEBOOK_API_H */ |