Changeset 3c9b095


Ignore:
Timestamp:
2010-09-06T09:26:39Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
ecae65f
Parents:
674a01d
Message:

libpurple insists on storing its own version of reality somewhere. I was
using /tmp so far but this wasn't a good idea. Try to use something saner.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/purple/purple.c

    r674a01d r3c9b095  
    8080        char help_title[64];
    8181        GString *help;
     82        static gboolean dir_fixed = FALSE;
     83       
     84        /* Layer violation coming up: Making an exception for libpurple here.
     85           Dig in the IRC state a bit to get a username. Ideally we should
     86           check if s/he identified but this info doesn't seem *that* important.
     87           It's just that fecking libpurple can't *not* store this shit.
     88           
     89           Remember that libpurple is not really meant to be used on public
     90           servers anyway! */
     91        if( !dir_fixed )
     92        {
     93                irc_t *irc = acc->bee->ui_data;
     94                char *dir;
     95               
     96                dir = g_strdup_printf( "%s/purple/%s", global.conf->configdir, irc->user->nick );
     97                purple_util_set_user_dir( dir );
     98                g_free( dir );
     99               
     100                purple_blist_load();
     101                purple_prefs_load();
     102                dir_fixed = TRUE;
     103        }
    82104       
    83105        help = g_string_new( "" );
     
    254276        PurpleAccount *pa;
    255277       
    256         if( local_bee != NULL && local_bee != acc->bee )
     278        if( ( local_bee != NULL && local_bee != acc->bee ) ||
     279            ( global.conf->runmode == RUNMODE_DAEMON && !getenv( "BITLBEE_DEBUG" ) ) )
    257280        {
    258281                imcb_error( ic,  "Daemon mode detected. Do *not* try to use libpurple in daemon mode! "
     
    351374        account_t *acc = set->data;
    352375        struct im_connection *ic = acc->ic;
     376       
     377        if( ic )
     378                imcb_log( ic, "Changing display_name not currently supported with libpurple!" );
    353379       
    354380        return NULL;
     
    517543}
    518544
    519 struct groupchat *purple_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password )
     545struct groupchat *purple_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password, set_t **sets )
    520546{
    521547        PurpleAccount *pa = ic->proto_data;
     
    11321158        GList *prots;
    11331159        GString *help;
     1160        char *dir;
    11341161       
    11351162        if( B_EV_IO_READ != PURPLE_INPUT_READ ||
     
    11401167        }
    11411168       
    1142         purple_util_set_user_dir( "/tmp" );
     1169        dir = g_strdup_printf( "%s/purple", global.conf->configdir );
     1170        purple_util_set_user_dir( dir );
     1171        g_free( dir );
     1172       
    11431173        purple_debug_set_enabled( FALSE );
    11441174        purple_core_set_ui_ops( &bee_core_uiops );
     
    11511181        }
    11521182       
    1153         /* This seems like stateful shit we don't want... */
    11541183        purple_set_blist( purple_blist_new() );
    1155         purple_blist_load();
    1156        
    1157         /* Meh? */
    1158         purple_prefs_load();
    11591184       
    11601185        /* No, really. So far there were ui_ops for everything, but now suddenly
     
    12211246       
    12221247        g_string_append( help, "\n\nFor used protocols, more information about available "
    1223                          "settings can be found using \x02help purple <protocol name>\x02" );
     1248                         "settings can be found using \x02help purple <protocol name>\x02 "
     1249                         "(create an account using that protocol first!)" );
    12241250       
    12251251        /* Add a simple dynamically-generated help item listing all
Note: See TracChangeset for help on using the changeset viewer.