Changeset b308cf9 for irc.c


Ignore:
Timestamp:
2010-06-05T23:21:02Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
1fdb0a4
Parents:
3ab1d31 (diff), e774815 (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:

Merging libpurple branch into killerbee. It's fairly usable already, and
Debian packaging is now properly separated. This also picks up a load of
stuff from mainline it seems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    r3ab1d31 rb308cf9  
    5252{
    5353        irc_t *irc = set->data;
     54        char *test;
     55        gsize test_bytes = 0;
    5456        GIConv ic, oc;
    5557
     
    5759                value = g_strdup( "utf-8" );
    5860
     61        if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 )
     62        {
     63                return NULL;
     64        }
     65       
     66        /* Do a test iconv to see if the user picked an IRC-compatible
     67           charset (for example utf-16 goes *horribly* wrong). */
     68        if( ( test = g_convert_with_iconv( " ", 1, oc, NULL, &test_bytes, NULL ) ) == NULL ||
     69            test_bytes > 1 )
     70        {
     71                g_free( test );
     72                g_iconv_close( oc );
     73                irc_usermsg( irc, "Unsupported character set: The IRC protocol "
     74                                  "only supports 8-bit character sets." );
     75                return NULL;
     76        }
     77        g_free( test );
     78       
    5979        if( ( ic = g_iconv_open( "utf-8", value ) ) == (GIConv) -1 )
    6080        {
    61                 return NULL;
    62         }
    63         if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 )
    64         {
    65                 g_iconv_close( ic );
     81                g_iconv_close( oc );
    6682                return NULL;
    6783        }
     
    109125        sock_make_nonblocking( irc->fd );
    110126       
    111         irc->r_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_READ, bitlbee_io_current_client_read, irc );
     127        irc->r_watch_source_id = b_input_add( irc->fd, B_EV_IO_READ, bitlbee_io_current_client_read, irc );
    112128       
    113129        irc->status = USTATUS_OFFLINE;
     
    175191        s = set_add( &irc->set, "default_target", "root", NULL, irc );
    176192        s = set_add( &irc->set, "display_namechanges", "false", set_eval_bool, irc );
     193        s = set_add( &irc->set, "display_timestamps", "true", set_eval_bool, irc );
    177194        s = set_add( &irc->set, "handle_unknown", "root", NULL, irc );
    178195        s = set_add( &irc->set, "lcnicks", "true", set_eval_bool, irc );
     
    184201        s = set_add( &irc->set, "root_nick", irc->mynick, set_eval_root_nick, irc );
    185202        s = set_add( &irc->set, "save_on_quit", "true", set_eval_bool, irc );
     203        s = set_add( &irc->set, "show_offline", "false", set_eval_bool, irc );
    186204        s = set_add( &irc->set, "simulate_netsplit", "true", set_eval_bool, irc );
    187205        s = set_add( &irc->set, "status", NULL,  set_eval_away_status, irc );
    188206        s->flags |= SET_NULL_OK;
    189207        s = set_add( &irc->set, "strip_html", "true", NULL, irc );
     208        s = set_add( &irc->set, "timezone", "local", set_eval_timezone, irc );
    190209        s = set_add( &irc->set, "to_char", ": ", set_eval_to_char, irc );
    191210        s = set_add( &irc->set, "typing_notice", "false", set_eval_bool, irc );
     
    195214        /* Evaluator sets the iconv/oconv structures. */
    196215        set_eval_charset( set_find( &irc->set, "charset" ), set_getstr( &irc->set, "charset" ) );
     216       
     217        nogaim_init();
    197218       
    198219        return( irc );
     
    677698                   in the event queue. */
    678699                /* Really can't be done as long as the code doesn't do error checking very well:
    679                 if( bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE ) ) */
     700                if( bitlbee_io_current_client_write( irc, irc->fd, B_EV_IO_WRITE ) ) */
    680701               
    681702                /* So just always do it via the event handler. */
    682                 irc->w_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_WRITE, bitlbee_io_current_client_write, irc );
     703                irc->w_watch_source_id = b_input_add( irc->fd, B_EV_IO_WRITE, bitlbee_io_current_client_write, irc );
    683704        }
    684705       
     
    706727                if( now )
    707728                {
    708                         bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE );
     729                        bitlbee_io_current_client_write( irc, irc->fd, B_EV_IO_WRITE );
    709730                }
    710731                temp = temp->next;
Note: See TracChangeset for help on using the changeset viewer.