Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.h

    rc6ca3ee rd860a8d  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2004 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2010 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    3939#define _NOGAIM_H
    4040
     41#include <stdint.h>
     42
    4143#include "bitlbee.h"
    4244#include "account.h"
    4345#include "proxy.h"
    4446#include "query.h"
     47#include "md5.h"
     48#include "ft.h"
    4549
    4650#define BUDDY_ALIAS_MAXLEN 388   /* because MSN names can be 387 characters */
    4751
    4852#define WEBSITE "http://www.bitlbee.org/"
    49 #define GAIM_AWAY_CUSTOM "Custom"
    5053
    5154/* Sharing flags between all kinds of things. I just hope I won't hit any
     
    8487       
    8588        /* BitlBee */
    86         irc_t *irc;
     89        bee_t *bee;
    8790       
    8891        struct groupchat *groupchats;
     
    208211         * not implement this. */
    209212        struct groupchat *
    210              (* chat_join)      (struct im_connection *, char *room, char *nick, char *password);
     213             (* chat_join)      (struct im_connection *, const char *room, const char *nick, const char *password);
    211214        /* Change the topic, if supported. Note that BitlBee expects the IM
    212215           server to confirm the topic change with a regular topic change
     
    216219       
    217220        /* You can tell what away states your protocol supports, so that
    218          * BitlBee will try to map the IRC away reasons to them, or use
    219          * GAIM_AWAY_CUSTOM when calling skype_set_away(). */
     221         * BitlBee will try to map the IRC away reasons to them. If your
     222         * protocol doesn't have any, just return one generic "Away". */
    220223        GList *(* away_states)(struct im_connection *ic);
    221224       
     
    223226         * - Most protocols will just want to set this to g_strcasecmp().*/
    224227        int (* handle_cmp) (const char *who1, const char *who2);
     228
     229        /* Implement these callbacks if you want to use imcb_ask_auth() */
     230        void (* auth_allow)     (struct im_connection *, const char *who);
     231        void (* auth_deny)      (struct im_connection *, const char *who);
     232
     233        /* Incoming transfer request */
     234        void (* transfer_request) (struct im_connection *, file_transfer_t *ft, char *handle );
    225235};
    226236
     
    238248 * the account_t parameter. */
    239249G_MODULE_EXPORT struct im_connection *imcb_new( account_t *acc );
    240 G_MODULE_EXPORT void imcb_free( struct im_connection *ic );
     250G_MODULE_EXPORT void imc_free( struct im_connection *ic );
    241251/* Once you're connected, you should call this function, so that the user will
    242252 * see the success. */
     
    251261/* To tell the user an error, ie. before logging out when an error occurs. */
    252262G_MODULE_EXPORT void imcb_error( struct im_connection *ic, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
     263
    253264/* To ask a your about something.
    254265 * - 'msg' is the question.
     
    257268 */
    258269G_MODULE_EXPORT void imcb_ask( struct im_connection *ic, char *msg, void *data, query_callback doit, query_callback dont );
    259 G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname );
     270
     271/* Two common questions you may want to ask:
     272 * - X added you to his contact list, allow?
     273 * - X is not in your contact list, want to add?
     274 */
     275G_MODULE_EXPORT void imcb_ask_auth( struct im_connection *ic, const char *handle, const char *realname );
     276G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, const char *handle, const char *realname );
    260277
    261278/* Buddy management */
     
    267284G_MODULE_EXPORT struct buddy *imcb_find_buddy( struct im_connection *ic, char *handle );
    268285G_MODULE_EXPORT void imcb_rename_buddy( struct im_connection *ic, const char *handle, const char *realname );
    269 G_MODULE_EXPORT void imcb_buddy_nick_hint( struct im_connection *ic, char *handle, char *nick );
    270 
    271 /* Buddy activity */
    272 /* To manipulate the status of a handle.
    273  * - flags can be |='d with OPT_* constants. You will need at least:
    274  *   OPT_LOGGED_IN and OPT_AWAY.
    275  * - 'state' and 'message' can be NULL */
    276 G_MODULE_EXPORT void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags, const char *state, const char *message );
    277 /* Not implemented yet! */ G_MODULE_EXPORT void imcb_buddy_times( struct im_connection *ic, const char *handle, time_t login, time_t idle );
    278 /* Call when a handle says something. 'flags' and 'sent_at may be just 0. */
    279 G_MODULE_EXPORT void imcb_buddy_msg( struct im_connection *ic, const char *handle, char *msg, uint32_t flags, time_t sent_at );
     286G_MODULE_EXPORT void imcb_buddy_nick_hint( struct im_connection *ic, const char *handle, const char *nick );
     287
    280288G_MODULE_EXPORT void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags );
     289G_MODULE_EXPORT struct bee_user *imcb_buddy_by_handle( struct im_connection *ic, const char *handle );
    281290G_MODULE_EXPORT void imcb_clean_handle( struct im_connection *ic, char *handle );
    282291
     
    302311
    303312/* Actions, or whatever. */
    304 int imc_set_away( struct im_connection *ic, char *away );
    305 int imc_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags );
     313int imc_away_send_update( struct im_connection *ic );
    306314int imc_chat_msg( struct groupchat *c, char *msg, int flags );
    307315
Note: See TracChangeset for help on using the changeset viewer.