diff options
Diffstat (limited to 'protocols/nogaim.h')
-rw-r--r-- | protocols/nogaim.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/protocols/nogaim.h b/protocols/nogaim.h index ee5d7a30..a523a3a5 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -38,6 +38,8 @@ #ifndef _NOGAIM_H #define _NOGAIM_H +#include <stdint.h> + #include "bitlbee.h" #include "account.h" #include "proxy.h" @@ -46,7 +48,6 @@ #define BUDDY_ALIAS_MAXLEN 388 /* because MSN names can be 387 characters */ #define WEBSITE "http://www.bitlbee.org/" -#define GAIM_AWAY_CUSTOM "Custom" /* Sharing flags between all kinds of things. I just hope I won't hit any limits before 32-bit machines become extinct. ;-) */ @@ -207,7 +208,7 @@ struct prpl { * your protocol does not support publicly named group chats, then do * not implement this. */ struct groupchat * - (* chat_join) (struct im_connection *, char *room, char *nick, char *password); + (* chat_join) (struct im_connection *, const char *room, const char *nick, const char *password); /* Change the topic, if supported. Note that BitlBee expects the IM server to confirm the topic change with a regular topic change event. If it doesn't do that, you have to fake it to make it @@ -215,13 +216,17 @@ struct prpl { void (* chat_topic) (struct groupchat *, char *topic); /* You can tell what away states your protocol supports, so that - * BitlBee will try to map the IRC away reasons to them, or use - * GAIM_AWAY_CUSTOM when calling skype_set_away(). */ + * BitlBee will try to map the IRC away reasons to them. If your + * protocol doesn't have any, just return one generic "Away". */ GList *(* away_states)(struct im_connection *ic); /* Mainly for AOL, since they think "Bung hole" == "Bu ngho le". *sigh* * - Most protocols will just want to set this to g_strcasecmp().*/ int (* handle_cmp) (const char *who1, const char *who2); + + /* Implement these callbacks if you want to use imcb_ask_auth() */ + void (* auth_allow) (struct im_connection *, const char *who); + void (* auth_deny) (struct im_connection *, const char *who); }; /* im_api core stuff. */ @@ -237,7 +242,7 @@ G_MODULE_EXPORT void register_protocol( struct prpl * ); /* You will need this function in prpl->login() to get an im_connection from * the account_t parameter. */ G_MODULE_EXPORT struct im_connection *imcb_new( account_t *acc ); -G_MODULE_EXPORT void imcb_free( struct im_connection *ic ); +G_MODULE_EXPORT void imc_free( struct im_connection *ic ); /* Once you're connected, you should call this function, so that the user will * see the success. */ G_MODULE_EXPORT void imcb_connected( struct im_connection *ic ); @@ -250,13 +255,20 @@ G_MODULE_EXPORT void imc_logout( struct im_connection *ic, int allow_reconnect ) G_MODULE_EXPORT void imcb_log( struct im_connection *ic, char *format, ... ) G_GNUC_PRINTF( 2, 3 ); /* To tell the user an error, ie. before logging out when an error occurs. */ G_MODULE_EXPORT void imcb_error( struct im_connection *ic, char *format, ... ) G_GNUC_PRINTF( 2, 3 ); + /* To ask a your about something. * - 'msg' is the question. * - 'data' can be your custom struct - it will be passed to the callbacks. * - 'doit' or 'dont' will be called depending of the answer of the user. */ G_MODULE_EXPORT void imcb_ask( struct im_connection *ic, char *msg, void *data, query_callback doit, query_callback dont ); -G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname ); + +/* Two common questions you may want to ask: + * - X added you to his contact list, allow? + * - X is not in your contact list, want to add? + */ +G_MODULE_EXPORT void imcb_ask_auth( struct im_connection *ic, const char *handle, const char *realname ); +G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, const char *handle, const char *realname ); /* Buddy management */ /* This function should be called for each handle which are visible to the @@ -266,7 +278,7 @@ G_MODULE_EXPORT void imcb_add_buddy( struct im_connection *ic, const char *handl G_MODULE_EXPORT void imcb_remove_buddy( struct im_connection *ic, const char *handle, char *group ); G_MODULE_EXPORT struct buddy *imcb_find_buddy( struct im_connection *ic, char *handle ); G_MODULE_EXPORT void imcb_rename_buddy( struct im_connection *ic, const char *handle, const char *realname ); -G_MODULE_EXPORT void imcb_buddy_nick_hint( struct im_connection *ic, char *handle, char *nick ); +G_MODULE_EXPORT void imcb_buddy_nick_hint( struct im_connection *ic, const char *handle, const char *nick ); /* Buddy activity */ /* To manipulate the status of a handle. @@ -301,7 +313,7 @@ G_MODULE_EXPORT void imcb_chat_topic( struct groupchat *c, char *who, char *topi G_MODULE_EXPORT void imcb_chat_free( struct groupchat *c ); /* Actions, or whatever. */ -int imc_set_away( struct im_connection *ic, char *away ); +int imc_away_send_update( struct im_connection *ic ); int imc_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags ); int imc_chat_msg( struct groupchat *c, char *msg, int flags ); |