Changeset ae3dc99 for irc.c


Ignore:
Timestamp:
2010-04-24T17:02:07Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
c521362
Parents:
b5b40ff (diff), f1b7711 (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 stuff from mainline (1.2.6).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    rb5b40ff rae3dc99  
    5353{
    5454        irc_t *irc = set->data;
     55        char *test;
     56        gsize test_bytes = 0;
    5557        GIConv ic, oc;
    5658
     
    5860                value = g_strdup( "utf-8" );
    5961
     62        if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 )
     63        {
     64                return NULL;
     65        }
     66       
     67        /* Do a test iconv to see if the user picked an IRC-compatible
     68           charset (for example utf-16 goes *horribly* wrong). */
     69        if( ( test = g_convert_with_iconv( " ", 1, oc, NULL, &test_bytes, NULL ) ) == NULL ||
     70            test_bytes > 1 )
     71        {
     72                g_free( test );
     73                g_iconv_close( oc );
     74                irc_usermsg( irc, "Unsupported character set: The IRC protocol "
     75                                  "only supports 8-bit character sets." );
     76                return NULL;
     77        }
     78        g_free( test );
     79       
    6080        if( ( ic = g_iconv_open( "utf-8", value ) ) == (GIConv) -1 )
    6181        {
    62                 return NULL;
    63         }
    64         if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 )
    65         {
    66                 g_iconv_close( ic );
     82                g_iconv_close( oc );
    6783                return NULL;
    6884        }
     
    176192        s = set_add( &irc->set, "default_target", "root", NULL, irc );
    177193        s = set_add( &irc->set, "display_namechanges", "false", set_eval_bool, irc );
     194        s = set_add( &irc->set, "display_timestamps", "true", set_eval_bool, irc );
    178195        s = set_add( &irc->set, "handle_unknown", "root", NULL, irc );
    179196        s = set_add( &irc->set, "lcnicks", "true", set_eval_bool, irc );
     
    189206        s->flags |= SET_NULL_OK;
    190207        s = set_add( &irc->set, "strip_html", "true", NULL, irc );
     208        s = set_add( &irc->set, "timezone", "local", set_eval_timezone, irc );
    191209        s = set_add( &irc->set, "to_char", ": ", set_eval_to_char, irc );
    192210        s = set_add( &irc->set, "typing_notice", "false", set_eval_bool, irc );
Note: See TracChangeset for help on using the changeset viewer.