aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/nogaim.h
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2009-10-17 18:24:52 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2009-10-17 18:24:52 +0100
commitc5bc47b3197d20ec2d73e3024b932db30dfa3533 (patch)
treec803b770edb779a331a7cf25a1c6fdad45450603 /protocols/nogaim.h
parent0c41177b49c04893e0ce88dbb27f5f5b1aeb5896 (diff)
parent2e44b1f12fb58a6969a8fbaf2946d6ecdace484a (diff)
Merging BitlBee 1.2.4.
Diffstat (limited to 'protocols/nogaim.h')
-rw-r--r--protocols/nogaim.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/protocols/nogaim.h b/protocols/nogaim.h
index 9fe843b5..1e5df503 100644
--- a/protocols/nogaim.h
+++ b/protocols/nogaim.h
@@ -208,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
@@ -223,6 +223,10 @@ struct prpl {
/* 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. */
@@ -238,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 );
@@ -251,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
@@ -289,7 +300,7 @@ G_MODULE_EXPORT void imcb_chat_invited( struct im_connection *ic, char *handle,
* - After you have a groupchat pointer, you should add the handles, finally
* the user her/himself. At that point the group chat will be visible to the
* user, too. */
-G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle );
+G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle );
G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, char *handle );
/* To remove a handle from a group chat. Reason can be NULL. */
G_MODULE_EXPORT void imcb_chat_remove_buddy( struct groupchat *b, char *handle, char *reason );