Changeset bd69a21 for protocols/nogaim.c


Ignore:
Timestamp:
2005-12-15T12:24:25Z (18 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
4146a07
Parents:
2983f5e (diff), bf02a67 (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.c

    r2983f5e rbd69a21  
    5555GSList *connections;
    5656
     57#ifdef WITH_PLUGINS
    5758gboolean load_plugin(char *path)
    5859{
     
    7576        return TRUE;
    7677}
     78
     79void load_plugins(void)
     80{
     81        GDir *dir;
     82        GError *error = NULL;
     83
     84        dir = g_dir_open(PLUGINDIR, 0, &error);
     85
     86        if (dir) {
     87                const gchar *entry;
     88                char *path;
     89
     90                while ((entry = g_dir_read_name(dir))) {
     91                        path = g_build_filename(PLUGINDIR, entry, NULL);
     92                        if(!path) {
     93                                log_message(LOGLVL_WARNING, "Can't build path for %s\n", entry);
     94                                continue;
     95                        }
     96
     97                        load_plugin(path);
     98
     99                        g_free(path);
     100                }
     101
     102                g_dir_close(dir);
     103        }
     104}
     105#endif
    77106
    78107/* nogaim.c */
     
    101130void nogaim_init()
    102131{
    103         GDir *dir;
    104         GError *error = NULL;
     132        extern void msn_init();
     133        extern void oscar_init();
     134        extern void byahoo_init();
     135        extern void jabber_init();
    105136
    106137#ifdef WITH_MSN
    107         extern void msn_init();
    108138        msn_init();
    109139#endif
    110140
    111141#ifdef WITH_OSCAR
    112         extern void oscar_init();
    113142        oscar_init();
    114143#endif
    115144       
    116145#ifdef WITH_YAHOO
    117         extern void byahoo_init();
    118146        byahoo_init();
    119147#endif
    120148       
    121149#ifdef WITH_JABBER
    122         extern void jabber_init();
    123150        jabber_init();
    124151#endif
    125152
    126         dir = g_dir_open(PLUGINDIR, 0, &error);
    127 
    128         if (dir) {
    129                 const gchar *entry;
    130                 char *path;
    131 
    132                 while ((entry = g_dir_read_name(dir))) {
    133                         path = g_build_filename(PLUGINDIR, entry, NULL);
    134                         if(!path) {
    135                                 log_message(LOGLVL_WARNING, "Can't build path for %s\n", entry);
    136                                 continue;
    137                         }
    138 
    139                         load_plugin(path);
    140 
    141                         g_free(path);
    142                 }
    143 
    144                 g_dir_close(dir);
    145         }
     153#ifdef WITH_PLUGINS
     154        load_plugins();
     155#endif
    146156}
    147157
     
    442452void do_error_dialog( struct gaim_connection *gc, char *msg, char *title )
    443453{
    444         serv_got_crap( gc, "Error: %s", msg );
     454        if( msg && title )
     455                serv_got_crap( gc, "Error: %s: %s", title, msg );
     456        else if( msg )
     457                serv_got_crap( gc, "Error: %s", msg );
     458        else if( title )
     459                serv_got_crap( gc, "Error: %s", title );
     460        else
     461                serv_got_crap( gc, "Error" );
    445462}
    446463
     
    727744                /* If there's a newline/space in this string, split up there,
    728745                   looks a bit prettier. */
    729                 if( ( nl = strrchr( msg, '\n' ) ) || ( nl = strchr( msg, ' ' ) ) )
     746                if( ( nl = strrchr( msg, '\n' ) ) || ( nl = strrchr( msg, ' ' ) ) )
    730747                {
    731748                        msg[425] = tmp;
     
    751768}
    752769
    753 void serv_got_typing( struct gaim_connection *gc, char *handle, int timeout )
     770void serv_got_typing( struct gaim_connection *gc, char *handle, int timeout, int type )
    754771{
    755772        user_t *u;
     
    758775                return;
    759776       
    760         if( ( u = user_findhandle( gc, handle ) ) )
    761                 irc_msgfrom( gc->irc, u->nick, "\1TYPING 1\1" );
     777        if( ( u = user_findhandle( gc, handle ) ) ) {
     778                /* If type is:
     779                 * 0: user has stopped typing
     780                 * 1: user is actively typing
     781                 * 2: user has entered text, but is not actively typing
     782                 */
     783                if (type == 0 || type == 1 || type == 2) {
     784                        char buf[256];
     785                        g_snprintf(buf, 256, "\1TYPING %d\1", type);
     786                        irc_privmsg( gc->irc, u, "PRIVMSG", gc->irc->nick, NULL, buf );
     787                }
     788        }
    762789}
    763790
Note: See TracChangeset for help on using the changeset viewer.