Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r449a51d r17a6ee9  
    3838#include "chat.h"
    3939
    40 static int remove_chat_buddy_silent( struct groupchat *b, const char *handle );
    41 
    4240GSList *connections;
    4341
     
    9189}
    9290#endif
    93 
    94 /* nogaim.c */
    9591
    9692GList *protocols = NULL;
     
    125121}
    126122
    127 /* nogaim.c */
    128123void nogaim_init()
    129124{
     
    156151GSList *get_connections() { return connections; }
    157152
    158 /* multi.c */
    159 
    160153struct im_connection *imcb_new( account_t *acc )
    161154{
     
    164157        ic = g_new0( struct im_connection, 1 );
    165158       
    166         ic->irc = acc->irc;
     159        ic->bee = acc->bee;
    167160        ic->acc = acc;
    168161        acc->ic = ic;
     
    178171       
    179172        /* Destroy the pointer to this connection from the account list */
    180         for( a = ic->irc->accounts; a; a = a->next )
     173        for( a = ic->bee->accounts; a; a = a->next )
    181174                if( a->ic == ic )
    182175                {
     
    199192        va_end( params );
    200193
    201         if( ( g_strcasecmp( set_getstr( &ic->irc->set, "strip_html" ), "always" ) == 0 ) ||
    202             ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc->set, "strip_html" ) ) )
     194        if( ( g_strcasecmp( set_getstr( &ic->bee->set, "strip_html" ), "always" ) == 0 ) ||
     195            ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->bee->set, "strip_html" ) ) )
    203196                strip_html( text );
    204197       
    205198        /* Try to find a different connection on the same protocol. */
    206         for( a = ic->irc->accounts; a; a = a->next )
     199        for( a = ic->bee->accounts; a; a = a->next )
    207200                if( a->prpl == ic->acc->prpl && a->ic != ic )
    208201                        break;
     
    210203        /* If we found one, include the screenname in the message. */
    211204        if( a )
    212                 irc_usermsg( ic->irc, "%s(%s) - %s", ic->acc->prpl->name, ic->acc->user, text );
     205                /* FIXME(wilmer): ui_log callback or so */
     206                irc_usermsg( ic->bee->ui_data, "%s(%s) - %s", ic->acc->prpl->name, ic->acc->user, text );
    213207        else
    214                 irc_usermsg( ic->irc, "%s - %s", ic->acc->prpl->name, text );
     208                irc_usermsg( ic->bee->ui_data, "%s - %s", ic->acc->prpl->name, text );
    215209       
    216210        g_free( text );
     
    263257void imcb_connected( struct im_connection *ic )
    264258{
    265         irc_t *irc = ic->irc;
    266         struct chat *c;
    267         user_t *u;
    268        
    269259        /* MSN servers sometimes redirect you to a different server and do
    270260           the whole login sequence again, so these "late" calls to this
     
    273263                return;
    274264       
    275         u = user_find( ic->irc, ic->irc->nick );
    276        
    277265        imcb_log( ic, "Logged in" );
    278266       
     
    287275        ic->acc->auto_reconnect_delay = 0;
    288276       
     277        /*
    289278        for( c = irc->chatrooms; c; c = c->next )
    290279        {
     
    295284                        chat_join( irc, c, NULL );
    296285        }
     286        */
    297287}
    298288
     
    302292       
    303293        a->reconnect = 0;
    304         account_on( a->irc, a );
     294        account_on( a->bee, a );
    305295       
    306296        return( FALSE );        /* Only have to run the timeout once */
     
    315305void imc_logout( struct im_connection *ic, int allow_reconnect )
    316306{
    317         irc_t *irc = ic->irc;
    318         user_t *t, *u;
     307        bee_t *bee = ic->bee;
    319308        account_t *a;
     309        GSList *l;
    320310        int delay;
    321311       
     
    337327        ic->away = NULL;
    338328       
    339         u = irc->users;
    340         while( u )
    341         {
    342                 if( u->ic == ic )
    343                 {
    344                         t = u->next;
    345                         user_del( irc, u->nick );
    346                         u = t;
    347                 }
    348                 else
    349                         u = u->next;
    350         }
    351        
    352         query_del_by_conn( ic->irc, ic );
    353        
    354         for( a = irc->accounts; a; a = a->next )
     329        for( l = bee->users; l; l = l->next )
     330        {
     331                bee_user_t *bu = l->data;
     332               
     333                if( bu->ic == ic )
     334                        bee_user_free( bee, ic, bu->handle );
     335        }
     336       
     337        //query_del_by_conn( ic->irc, ic );
     338       
     339        for( a = bee->accounts; a; a = a->next )
    355340                if( a->ic == ic )
    356341                        break;
     
    360345                /* Uhm... This is very sick. */
    361346        }
    362         else if( allow_reconnect && set_getbool( &irc->set, "auto_reconnect" ) &&
     347        else if( allow_reconnect && set_getbool( &bee->set, "auto_reconnect" ) &&
    363348                 set_getbool( &a->set, "auto_reconnect" ) &&
    364349                 ( delay = account_reconnect_delay( a ) ) > 0 )
     
    371356}
    372357
    373 
    374 /* dialogs.c */
    375 
    376358void imcb_ask( struct im_connection *ic, char *msg, void *data,
    377359               query_callback doit, query_callback dont )
    378360{
    379         query_add( ic->irc, ic, msg, doit, dont, data );
    380 }
    381 
    382 
    383 /* list.c */
     361        //query_add( ic->irc, ic, msg, doit, dont, data );
     362}
    384363
    385364void imcb_add_buddy( struct im_connection *ic, const char *handle, const char *group )
    386365{
    387         user_t *u;
    388         char nick[MAX_NICK_LENGTH+1], *s;
    389         irc_t *irc = ic->irc;
    390        
    391         if( user_findhandle( ic, handle ) )
    392         {
    393                 if( set_getbool( &irc->set, "debug" ) )
     366        bee_user_t *bu;
     367        bee_t *bee = ic->bee;
     368       
     369        if( bee_user_by_handle( bee, ic, handle ) )
     370        {
     371                if( set_getbool( &bee->set, "debug" ) )
    394372                        imcb_log( ic, "User already exists, ignoring add request: %s", handle );
    395373               
     
    402380        }
    403381       
    404         memset( nick, 0, MAX_NICK_LENGTH + 1 );
    405         strcpy( nick, nick_get( ic->acc, handle ) );
    406        
    407         u = user_add( ic->irc, nick );
    408        
    409 //      if( !realname || !*realname ) realname = nick;
    410 //      u->realname = g_strdup( realname );
    411        
    412         if( ( s = strchr( handle, '@' ) ) )
    413         {
    414                 u->host = g_strdup( s + 1 );
    415                 u->user = g_strndup( handle, s - handle );
    416         }
    417         else if( ic->acc->server )
    418         {
    419                 u->host = g_strdup( ic->acc->server );
    420                 u->user = g_strdup( handle );
    421                
    422                 /* s/ /_/ ... important for AOL screennames */
    423                 for( s = u->user; *s; s ++ )
    424                         if( *s == ' ' )
    425                                 *s = '_';
    426         }
    427         else
    428         {
    429                 u->host = g_strdup( ic->acc->prpl->name );
    430                 u->user = g_strdup( handle );
    431         }
    432        
    433         u->ic = ic;
    434         u->handle = g_strdup( handle );
    435         if( group ) u->group = g_strdup( group );
    436         u->send_handler = buddy_send_handler;
    437         u->last_typing_notice = 0;
    438 }
    439 
    440 struct buddy *imcb_find_buddy( struct im_connection *ic, char *handle )
    441 {
    442         static struct buddy b[1];
    443         user_t *u;
    444        
    445         u = user_findhandle( ic, handle );
    446        
    447         if( !u )
    448                 return( NULL );
    449        
    450         memset( b, 0, sizeof( b ) );
    451         strncpy( b->name, handle, 80 );
    452         strncpy( b->show, u->realname, BUDDY_ALIAS_MAXLEN );
    453         b->present = u->online;
    454         b->ic = u->ic;
    455        
    456         return( b );
    457 }
    458 
    459 void imcb_rename_buddy( struct im_connection *ic, const char *handle, const char *realname )
    460 {
    461         user_t *u = user_findhandle( ic, handle );
    462         char *set;
    463        
    464         if( !u || !realname ) return;
    465        
    466         if( g_strcasecmp( u->realname, realname ) != 0 )
    467         {
    468                 if( u->realname != u->nick ) g_free( u->realname );
    469                
    470                 u->realname = g_strdup( realname );
    471                
    472                 if( ( ic->flags & OPT_LOGGED_IN ) && set_getbool( &ic->irc->set, "display_namechanges" ) )
    473                         imcb_log( ic, "User `%s' changed name to `%s'", u->nick, u->realname );
    474         }
    475        
    476         set = set_getstr( &ic->acc->set, "nick_source" );
    477         if( strcmp( set, "handle" ) != 0 )
    478         {
    479                 char *name = g_strdup( realname );
    480                
    481                 if( strcmp( set, "first_name" ) == 0 )
    482                 {
    483                         int i;
    484                         for( i = 0; name[i] && !isspace( name[i] ); i ++ ) {}
    485                         name[i] = '\0';
    486                 }
    487                
    488                 imcb_buddy_nick_hint( ic, handle, name );
    489                
    490                 g_free( name );
     382        bu = bee_user_new( bee, ic, handle );
     383        bu->group = g_strdup( group );
     384}
     385
     386void imcb_rename_buddy( struct im_connection *ic, const char *handle, const char *fullname )
     387{
     388        bee_t *bee = ic->bee;
     389        bee_user_t *bu = bee_user_by_handle( bee, ic, handle );
     390       
     391        if( !bu || !fullname ) return;
     392       
     393        if( !bu->fullname || strcmp( bu->fullname, fullname ) != 0 )
     394        {
     395                g_free( bu->fullname );
     396                bu->fullname = g_strdup( fullname );
     397               
     398                if( bee->ui->user_fullname )
     399                        bee->ui->user_fullname( bee, bu );
    491400        }
    492401}
     
    494403void imcb_remove_buddy( struct im_connection *ic, const char *handle, char *group )
    495404{
    496         user_t *u;
    497        
    498         if( ( u = user_findhandle( ic, handle ) ) )
    499                 user_del( ic->irc, u->nick );
     405        bee_user_free( ic->bee, ic, handle );
    500406}
    501407
     
    504410void imcb_buddy_nick_hint( struct im_connection *ic, const char *handle, const char *nick )
    505411{
     412#if 0
    506413        user_t *u = user_findhandle( ic, handle );
    507414        char newnick[MAX_NICK_LENGTH+1], *orig_nick;
     
    518425                /* Some processing to make sure this string is a valid IRC nickname. */
    519426                nick_strip( newnick );
    520                 if( set_getbool( &ic->irc->set, "lcnicks" ) )
     427                if( set_getbool( &ic->bee->set, "lcnicks" ) )
    521428                        nick_lc( newnick );
    522429               
     
    535442                }
    536443        }
     444#endif
    537445}
    538446
     
    544452};
    545453
     454#if 0
    546455static void imcb_ask_auth_cb_no( void *data )
    547456{
     
    563472        g_free( cbd );
    564473}
     474#endif
    565475
    566476void imcb_ask_auth( struct im_connection *ic, const char *handle, const char *realname )
    567477{
     478#if 0
    568479        struct imcb_ask_cb_data *data = g_new0( struct imcb_ask_cb_data, 1 );
    569480        char *s, *realname_ = NULL;
     
    580491        data->handle = g_strdup( handle );
    581492        query_add( ic->irc, ic, s, imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, data );
    582 }
    583 
    584 
     493#endif
     494}
     495
     496
     497#if 0
    585498static void imcb_ask_add_cb_no( void *data )
    586499{
     
    597510        return imcb_ask_add_cb_no( data );
    598511}
     512#endif
    599513
    600514void imcb_ask_add( struct im_connection *ic, const char *handle, const char *realname )
    601515{
     516#if 0
    602517        struct imcb_ask_cb_data *data = g_new0( struct imcb_ask_cb_data, 1 );
    603518        char *s;
     
    612527        data->handle = g_strdup( handle );
    613528        query_add( ic->irc, ic, s, imcb_ask_add_cb_yes, imcb_ask_add_cb_no, data );
    614 }
    615 
    616 
    617 /* server.c */                   
    618 
    619 void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags, const char *state, const char *message )
    620 {
     529#endif
     530}
     531
     532void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags )
     533{
     534#if 0
    621535        user_t *u;
    622         int oa, oo;
    623        
    624         u = user_findhandle( ic, (char*) handle );
    625        
    626         if( !u )
    627         {
    628                 if( g_strcasecmp( set_getstr( &ic->irc->set, "handle_unknown" ), "add" ) == 0 )
    629                 {
    630                         imcb_add_buddy( ic, (char*) handle, NULL );
    631                         u = user_findhandle( ic, (char*) handle );
    632                 }
    633                 else
    634                 {
    635                         if( set_getbool( &ic->irc->set, "debug" ) || g_strcasecmp( set_getstr( &ic->irc->set, "handle_unknown" ), "ignore" ) != 0 )
    636                         {
    637                                 imcb_log( ic, "imcb_buddy_status() for unknown handle %s:", handle );
    638                                 imcb_log( ic, "flags = %d, state = %s, message = %s", flags,
    639                                           state ? state : "NULL", message ? message : "NULL" );
    640                         }
    641                        
    642                         return;
    643                 }
    644         }
    645        
    646         oa = u->away != NULL;
    647         oo = u->online;
    648        
    649         g_free( u->away );
    650         g_free( u->status_msg );
    651         u->away = u->status_msg = NULL;
    652        
    653         if( ( flags & OPT_LOGGED_IN ) && !u->online )
    654         {
    655                 irc_spawn( ic->irc, u );
    656                 u->online = 1;
    657         }
    658         else if( !( flags & OPT_LOGGED_IN ) && u->online )
    659         {
    660                 struct groupchat *c;
    661                
    662                 irc_kill( ic->irc, u );
    663                 u->online = 0;
    664                
    665                 /* Remove him/her from the groupchats to prevent PART messages after he/she QUIT already */
    666                 for( c = ic->groupchats; c; c = c->next )
    667                         remove_chat_buddy_silent( c, handle );
    668         }
    669        
    670         if( flags & OPT_AWAY )
    671         {
    672                 if( state && message )
    673                 {
    674                         u->away = g_strdup_printf( "%s (%s)", state, message );
    675                 }
    676                 else if( state )
    677                 {
    678                         u->away = g_strdup( state );
    679                 }
    680                 else if( message )
    681                 {
    682                         u->away = g_strdup( message );
    683                 }
    684                 else
    685                 {
    686                         u->away = g_strdup( "Away" );
    687                 }
    688         }
    689         else
    690         {
    691                 u->status_msg = g_strdup( message );
    692         }
    693        
    694         /* LISPy... */
    695         if( ( set_getbool( &ic->irc->set, "away_devoice" ) ) &&         /* Don't do a thing when user doesn't want it */
    696             ( u->online ) &&                                            /* Don't touch offline people */
    697             ( ( ( u->online != oo ) && !u->away ) ||                    /* Voice joining people */
    698               ( ( u->online == oo ) && ( oa == !u->away ) ) ) )         /* (De)voice people changing state */
    699         {
    700                 char *from;
    701                
    702                 if( set_getbool( &ic->irc->set, "simulate_netsplit" ) )
    703                 {
    704                         from = g_strdup( ic->irc->myhost );
    705                 }
    706                 else
    707                 {
    708                         from = g_strdup_printf( "%s!%s@%s", ic->irc->mynick, ic->irc->mynick,
    709                                                             ic->irc->myhost );
    710                 }
    711                 irc_write( ic->irc, ":%s MODE %s %cv %s", from, ic->irc->channel,
    712                                                           u->away?'-':'+', u->nick );
    713                 g_free( from );
    714         }
    715 }
    716 
    717 void imcb_buddy_msg( struct im_connection *ic, const char *handle, char *msg, uint32_t flags, time_t sent_at )
    718 {
    719         irc_t *irc = ic->irc;
    720         char *wrapped;
    721         user_t *u;
    722        
    723         u = user_findhandle( ic, handle );
    724        
    725         if( !u )
    726         {
    727                 char *h = set_getstr( &irc->set, "handle_unknown" );
    728                
    729                 if( g_strcasecmp( h, "ignore" ) == 0 )
    730                 {
    731                         if( set_getbool( &irc->set, "debug" ) )
    732                                 imcb_log( ic, "Ignoring message from unknown handle %s", handle );
    733                        
    734                         return;
    735                 }
    736                 else if( g_strncasecmp( h, "add", 3 ) == 0 )
    737                 {
    738                         int private = set_getbool( &irc->set, "private" );
    739                        
    740                         if( h[3] )
    741                         {
    742                                 if( g_strcasecmp( h + 3, "_private" ) == 0 )
    743                                         private = 1;
    744                                 else if( g_strcasecmp( h + 3, "_channel" ) == 0 )
    745                                         private = 0;
    746                         }
    747                        
    748                         imcb_add_buddy( ic, handle, NULL );
    749                         u = user_findhandle( ic, handle );
    750                         u->is_private = private;
    751                 }
    752                 else
    753                 {
    754                         imcb_log( ic, "Message from unknown handle %s:", handle );
    755                         u = user_find( irc, irc->mynick );
    756                 }
    757         }
    758        
    759         if( ( g_strcasecmp( set_getstr( &ic->irc->set, "strip_html" ), "always" ) == 0 ) ||
    760             ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc->set, "strip_html" ) ) )
    761                 strip_html( msg );
    762 
    763         wrapped = word_wrap( msg, 425 );
    764         irc_msgfrom( irc, u->nick, wrapped );
    765         g_free( wrapped );
    766 }
    767 
    768 void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags )
    769 {
    770         user_t *u;
    771        
    772         if( !set_getbool( &ic->irc->set, "typing_notice" ) )
     536       
     537        if( !set_getbool( &ic->bee->set, "typing_notice" ) )
    773538                return;
    774539       
     
    780545                irc_privmsg( ic->irc, u, "PRIVMSG", ic->irc->nick, NULL, buf );
    781546        }
     547#endif
     548}
     549
     550struct bee_user *imcb_buddy_by_handle( struct im_connection *ic, const char *handle )
     551{
     552        return bee_user_by_handle( ic->bee, ic, handle );
    782553}
    783554
    784555struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle )
    785556{
     557#if 0
    786558        struct groupchat *c;
    787559       
     
    801573        c->topic = g_strdup_printf( "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", c->title );
    802574       
    803         if( set_getbool( &ic->irc->set, "debug" ) )
     575        if( set_getbool( &ic->bee->set, "debug" ) )
    804576                imcb_log( ic, "Creating new conversation: (id=%p,handle=%s)", c, handle );
    805577       
    806578        return c;
     579#endif
     580        return NULL;
    807581}
    808582
    809583void imcb_chat_free( struct groupchat *c )
    810584{
     585#if 0
    811586        struct im_connection *ic = c->ic;
    812587        struct groupchat *l;
    813588        GList *ir;
    814589       
    815         if( set_getbool( &ic->irc->set, "debug" ) )
     590        if( set_getbool( &ic->bee->set, "debug" ) )
    816591                imcb_log( ic, "You were removed from conversation %p", c );
    817592       
     
    846621                g_free( c );
    847622        }
     623#endif
    848624}
    849625
    850626void imcb_chat_msg( struct groupchat *c, const char *who, char *msg, uint32_t flags, time_t sent_at )
    851627{
     628#if 0
    852629        struct im_connection *ic = c->ic;
    853630        char *wrapped;
     
    860637        u = user_findhandle( ic, who );
    861638       
    862         if( ( g_strcasecmp( set_getstr( &ic->irc->set, "strip_html" ), "always" ) == 0 ) ||
    863             ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc->set, "strip_html" ) ) )
     639        if( ( g_strcasecmp( set_getstr( &ic->bee->set, "strip_html" ), "always" ) == 0 ) ||
     640            ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->bee->set, "strip_html" ) ) )
    864641                strip_html( msg );
    865642       
     
    874651        }
    875652        g_free( wrapped );
     653#endif
    876654}
    877655
    878656void imcb_chat_log( struct groupchat *c, char *format, ... )
    879657{
     658#if 0
    880659        irc_t *irc = c->ic->irc;
    881660        va_list params;
     
    892671       
    893672        g_free( text );
     673#endif
    894674}
    895675
    896676void imcb_chat_topic( struct groupchat *c, char *who, char *topic, time_t set_at )
    897677{
     678#if 0
    898679        struct im_connection *ic = c->ic;
    899680        user_t *u = NULL;
     
    906687                u = user_findhandle( ic, who );
    907688       
    908         if( ( g_strcasecmp( set_getstr( &ic->irc->set, "strip_html" ), "always" ) == 0 ) ||
    909             ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc->set, "strip_html" ) ) )
     689        if( ( g_strcasecmp( set_getstr( &ic->bee->set, "strip_html" ), "always" ) == 0 ) ||
     690            ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->bee->set, "strip_html" ) ) )
    910691                strip_html( topic );
    911692       
     
    915696        if( c->joined && u )
    916697                irc_write( ic->irc, ":%s!%s@%s TOPIC %s :%s", u->nick, u->user, u->host, c->channel, topic );
    917 }
    918 
    919 
    920 /* buddy_chat.c */
     698#endif
     699}
    921700
    922701void imcb_chat_add_buddy( struct groupchat *b, const char *handle )
    923702{
     703#if 0
    924704        user_t *u = user_findhandle( b->ic, handle );
    925705        int me = 0;
    926706       
    927         if( set_getbool( &b->ic->irc->set, "debug" ) )
     707        if( set_getbool( &b->ic->bee->set, "debug" ) )
    928708                imcb_log( b->ic, "User %s added to conversation %p", handle, b );
    929709       
     
    952732                b->in_room = g_list_append( b->in_room, g_strdup( handle ) );
    953733        }
     734#endif
    954735}
    955736
     
    957738void imcb_chat_remove_buddy( struct groupchat *b, const char *handle, const char *reason )
    958739{
     740#if 0
    959741        user_t *u;
    960742        int me = 0;
    961743       
    962         if( set_getbool( &b->ic->irc->set, "debug" ) )
     744        if( set_getbool( &b->ic->bee->set, "debug" ) )
    963745                imcb_log( b->ic, "User %s removed from conversation %p (%s)", handle, b, reason ? reason : "" );
    964746       
     
    980762        if( me || ( remove_chat_buddy_silent( b, handle ) && b->joined && u ) )
    981763                irc_part( b->ic->irc, u, b->channel );
    982 }
    983 
     764#endif
     765}
     766
     767#if 0
    984768static int remove_chat_buddy_silent( struct groupchat *b, const char *handle )
    985769{
     
    1000784        }
    1001785       
    1002         return( 0 );
    1003 }
     786        return 0;
     787}
     788#endif
    1004789
    1005790
    1006791/* Misc. BitlBee stuff which shouldn't really be here */
    1007 
     792#if 0
    1008793char *set_eval_away_devoice( set_t *set, char *value )
    1009794{
     
    1018803        /* Horror.... */
    1019804       
    1020         if( st != set_getbool( &irc->set, "away_devoice" ) )
     805        if( st != set_getbool( &irc->b->set, "away_devoice" ) )
    1021806        {
    1022807                char list[80] = "";
     
    1060845        return value;
    1061846}
    1062 
     847#endif
    1063848
    1064849
     
    1067852   them all from some wrappers. We'll start to define some down here: */
    1068853
    1069 int imc_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags )
     854int imc_chat_msg( struct groupchat *c, char *msg, int flags )
    1070855{
    1071856        char *buf = NULL;
    1072         int st;
    1073        
    1074         if( ( ic->flags & OPT_DOES_HTML ) && ( g_strncasecmp( msg, "<html>", 6 ) != 0 ) )
     857       
     858        if( ( c->ic->flags & OPT_DOES_HTML ) && ( g_strncasecmp( msg, "<html>", 6 ) != 0 ) )
    1075859        {
    1076860                buf = escape_html( msg );
     
    1078862        }
    1079863       
    1080         st = ic->acc->prpl->buddy_msg( ic, handle, msg, flags );
    1081         g_free( buf );
    1082        
    1083         return st;
    1084 }
    1085 
    1086 int imc_chat_msg( struct groupchat *c, char *msg, int flags )
    1087 {
    1088         char *buf = NULL;
    1089        
    1090         if( ( c->ic->flags & OPT_DOES_HTML ) && ( g_strncasecmp( msg, "<html>", 6 ) != 0 ) )
    1091         {
    1092                 buf = escape_html( msg );
    1093                 msg = buf;
    1094         }
    1095        
    1096864        c->ic->acc->prpl->chat_msg( c, msg, flags );
    1097865        g_free( buf );
     
    1107875       
    1108876        away = set_getstr( &ic->acc->set, "away" ) ?
    1109              : set_getstr( &ic->irc->set, "away" );
     877             : set_getstr( &ic->bee->set, "away" );
    1110878        if( away && *away )
    1111879        {
     
    1118886                away = NULL;
    1119887                msg = set_getstr( &ic->acc->set, "status" ) ?
    1120                     : set_getstr( &ic->irc->set, "status" );
     888                    : set_getstr( &ic->bee->set, "status" );
    1121889        }
    1122890       
Note: See TracChangeset for help on using the changeset viewer.