Changeset 9779c18 for protocols/nogaim.h


Ignore:
Timestamp:
2006-06-03T20:20:43Z (18 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
5973412
Parents:
a15c097 (diff), fb62f81f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

[merge] Wilmer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.h

    ra15c097 r9779c18  
    1515 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
    1616 *                          (and possibly other members of the Gaim team)
    17  * Copyright 2002-2004 Wilmer van der Gaast <lintux@lintux.cx>
     17 * Copyright 2002-2004 Wilmer van der Gaast <wilmer@gaast.net>
    1818 */
    1919
     
    5252#define BUDDY_ALIAS_MAXLEN 388   /* because MSN names can be 387 characters */
    5353
    54 #define PERMIT_ALL      1
    55 #define PERMIT_NONE     2
    56 #define PERMIT_SOME     3
    57 #define DENY_SOME       4
    58 
    59 #define WEBSITE "http://www.bitlee.org/"
     54#define WEBSITE "http://www.bitlbee.org/"
    6055#define IM_FLAG_AWAY 0x0020
    61 #define OPT_CONN_HTML 0x00000001
    62 #define OPT_LOGGED_IN 0x00010000
    6356#define GAIM_AWAY_CUSTOM "Custom"
    6457
    65 #define GAIM_LOGO       0
    66 #define GAIM_ERROR      1
    67 #define GAIM_WARNING    2
    68 #define GAIM_INFO       3
     58#define OPT_CONN_HTML   0x00000001
     59#define OPT_LOGGED_IN   0x00010000
     60#define OPT_LOGGING_OUT 0x00020000
    6961
    7062/* ok. now the fun begins. first we create a connection structure */
    71 struct gaim_connection {
    72         /* we need to do either oscar or TOC */
    73         /* we make this as an int in case if we want to add more protocols later */
     63struct gaim_connection
     64{
    7465        struct prpl *prpl;
    7566        guint32 flags;
    7667       
     68        /* each connection then can have its own protocol-specific data */
     69        void *proto_data;
     70       
    7771        /* all connections need an input watcher */
    7872        int inpa;
     73        guint keepalive;
    7974       
    8075        /* buddy list stuff. there is still a global groups for the buddy list, but
     
    8479        int permdeny;
    8580       
    86         /* all connections need a list of chats, even if they don't have chat */
    87         GSList *buddy_chats;
    88        
    89         /* each connection then can have its own protocol-specific data */
    90         void *proto_data;
    91        
    9281        struct aim_user *user;
    9382       
     
    9584        char displayname[128];
    9685        char password[32];
    97         guint keepalive;
    98         /* stuff needed for per-connection idle times */
    99         guint idle_timer;
    100         time_t login_time;
    101         time_t lastsent;
    102         int is_idle;
    10386       
    10487        char *away;
    105         int is_auto_away;
    10688       
    10789        int evil;
     
    11092        /* BitlBee */
    11193        irc_t *irc;
    112         int lstitems;  /* added for msnP8 */
    11394       
    11495        struct conversation *conversations;
     
    164145        const char *name;
    165146
    166         /* for ICQ and Yahoo, who have off/on per-conversation options */
    167         /* char *checkbox; this should be per-connection */
    168 
    169         GList *(* away_states)(struct gaim_connection *gc);
    170         GList *(* actions)();
    171         void   (* do_action)(struct gaim_connection *, char *);
    172         /* user_opts returns a GList* of g_malloc'd struct proto_user_opts */
    173         GList *(* user_opts)();
    174         GList *(* chat_info)(struct gaim_connection *);
    175 
    176         /* all the server-related functions */
    177 
    178         /* a lot of these (like get_dir) are protocol-dependent and should be removed. ones like
    179          * set_dir (which is also protocol-dependent) can stay though because there's a dialog
    180          * (i.e. the prpl says you can set your dir info, the ui shows a dialog and needs to call
    181          * set_dir in order to set it) */
    182 
    183147        void (* login)          (struct aim_user *);
     148        void (* keepalive)      (struct gaim_connection *);
    184149        void (* close)          (struct gaim_connection *);
     150       
    185151        int  (* send_im)        (struct gaim_connection *, char *who, char *message, int len, int away);
    186         int  (* send_typing)    (struct gaim_connection *, char *who, int typing);
    187         void (* set_info)       (struct gaim_connection *, char *info);
    188         void (* get_info)       (struct gaim_connection *, char *who);
    189152        void (* set_away)       (struct gaim_connection *, char *state, char *message);
    190153        void (* get_away)       (struct gaim_connection *, char *who);
    191         void (* set_idle)       (struct gaim_connection *, int idletime);
     154        int  (* send_typing)    (struct gaim_connection *, char *who, int typing);
     155       
    192156        void (* add_buddy)      (struct gaim_connection *, char *name);
     157        void (* group_buddy)    (struct gaim_connection *, char *who, char *old_group, char *new_group);
    193158        void (* remove_buddy)   (struct gaim_connection *, char *name, char *group);
    194159        void (* add_permit)     (struct gaim_connection *, char *name);
     
    197162        void (* rem_deny)       (struct gaim_connection *, char *name);
    198163        void (* set_permit_deny)(struct gaim_connection *);
     164       
     165        void (* set_info)       (struct gaim_connection *, char *info);
     166        void (* get_info)       (struct gaim_connection *, char *who);
     167        void (* alias_buddy)    (struct gaim_connection *, char *who);  /* save/store buddy's alias on server list/roster */
     168       
     169        /* Group chat stuff. */
    199170        void (* join_chat)      (struct gaim_connection *, GList *data);
    200171        void (* chat_invite)    (struct gaim_connection *, int id, char *who, char *message);
    201172        void (* chat_leave)     (struct gaim_connection *, int id);
    202         void (* chat_whisper)   (struct gaim_connection *, int id, char *who, char *message);
    203173        int  (* chat_send)      (struct gaim_connection *, int id, char *message);
    204174        int  (* chat_open)      (struct gaim_connection *, char *who);
    205         void (* keepalive)      (struct gaim_connection *);
    206 
    207         /* get "chat buddy" info and away message */
    208         void (* get_cb_info)    (struct gaim_connection *, int, char *who);
    209         void (* get_cb_away)    (struct gaim_connection *, int, char *who);
    210 
    211         /* save/store buddy's alias on server list/roster */
    212         void (* alias_buddy)    (struct gaim_connection *, char *who);
    213 
    214         /* change a buddy's group on a server list/roster */
    215         void (* group_buddy)    (struct gaim_connection *, char *who, char *old_group, char *new_group);
    216 
    217         void (* buddy_free)     (struct buddy *);
    218 
     175       
     176        /* DIE! */
    219177        char *(* get_status_string) (struct gaim_connection *gc, int stat);
    220 
     178       
     179        GList *(* away_states)(struct gaim_connection *gc);
     180       
     181        /* Mainly for AOL, since they think "Bung hole" == "Bu ngho le". *sigh* */
    221182        int (* cmp_buddynames) (const char *who1, const char *who2);
    222183};
     
    235196
    236197/* nogaim.c */
    237 int serv_send_im(irc_t *irc, user_t *u, char *msg, int flags);
    238 int serv_send_chat(irc_t *irc, struct gaim_connection *gc, int id, char *msg );
    239 
    240 G_MODULE_EXPORT signed int do_iconv( char *from_cs, char *to_cs, char *src, char *dst, size_t size, size_t maxbuf );
    241 char *set_eval_charset( irc_t *irc, set_t *set, char *value );
     198int bim_set_away( struct gaim_connection *gc, char *away );
     199int bim_buddy_msg( struct gaim_connection *gc, char *handle, char *msg, int flags );
     200int bim_chat_msg( struct gaim_connection *gc, int id, char *msg );
     201
     202void bim_add_allow( struct gaim_connection *gc, char *handle );
     203void bim_rem_allow( struct gaim_connection *gc, char *handle );
     204void bim_add_block( struct gaim_connection *gc, char *handle );
     205void bim_rem_block( struct gaim_connection *gc, char *handle );
    242206
    243207void nogaim_init();
    244 int proto_away( struct gaim_connection *gc, char *away );
    245208char *set_eval_away_devoice( irc_t *irc, set_t *set, char *value );
    246209
     
    254217G_MODULE_EXPORT void hide_login_progress( struct gaim_connection *gc, char *msg );
    255218G_MODULE_EXPORT void hide_login_progress_error( struct gaim_connection *gc, char *msg );
    256 G_MODULE_EXPORT void serv_got_crap( struct gaim_connection *gc, char *format, ... );
     219G_MODULE_EXPORT void serv_got_crap( struct gaim_connection *gc, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
    257220G_MODULE_EXPORT void account_online( struct gaim_connection *gc );
    258 G_MODULE_EXPORT void account_offline( struct gaim_connection *gc );
    259221G_MODULE_EXPORT void signoff( struct gaim_connection *gc );
    260222
     
    264226
    265227/* list.c */
    266 G_MODULE_EXPORT int bud_list_cache_exists( struct gaim_connection *gc );
    267 G_MODULE_EXPORT void do_import( struct gaim_connection *gc, void *null );
    268228G_MODULE_EXPORT void add_buddy( struct gaim_connection *gc, char *group, char *handle, char *realname );
    269229G_MODULE_EXPORT struct buddy *find_buddy( struct gaim_connection *gc, char *handle );
    270 G_MODULE_EXPORT void do_export( struct gaim_connection *gc );
    271230G_MODULE_EXPORT void signoff_blocked( struct gaim_connection *gc );
    272231
     
    278237
    279238/* prpl.c */
    280 G_MODULE_EXPORT void show_got_added( struct gaim_connection *gc, char *id, char *handle, const char *realname, const char *msg );
     239G_MODULE_EXPORT void show_got_added( struct gaim_connection *gc, char *handle, const char *realname );
    281240
    282241/* server.c */                   
     
    289248G_MODULE_EXPORT void serv_got_chat_left( struct gaim_connection *gc, int id );
    290249
    291 /* util.c */
    292 G_MODULE_EXPORT void strip_linefeed( gchar *text );
    293 G_MODULE_EXPORT char *add_cr( char *text );
    294 G_MODULE_EXPORT char *tobase64( const char *text );
    295 G_MODULE_EXPORT char *normalize( const char *s );
    296 G_MODULE_EXPORT time_t get_time( int year, int month, int day, int hour, int min, int sec );
    297 G_MODULE_EXPORT void strip_html( char *msg );
    298 G_MODULE_EXPORT char *escape_html( const char *html );
    299 G_MODULE_EXPORT void info_string_append(GString *str, char *newline, char *name, char *value);
    300 G_MODULE_EXPORT char *ipv6_wrap( char *src );
    301 G_MODULE_EXPORT char *ipv6_unwrap( char *src );
    302 
    303 /* prefs.c */
    304 G_MODULE_EXPORT void build_block_list();
    305 G_MODULE_EXPORT void build_allow_list();
    306 
    307250struct conversation *conv_findchannel( char *channel );
    308251
    309 
    310252#endif
Note: See TracChangeset for help on using the changeset viewer.