Changes in irc.c [3e57660:e1720ce]
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r3e57660 re1720ce 52 52 { 53 53 irc_t *irc = set->data; 54 char *test;55 gsize test_bytes = 0;56 54 GIConv ic, oc; 57 55 … … 59 57 value = g_strdup( "utf-8" ); 60 58 59 if( ( ic = g_iconv_open( "utf-8", value ) ) == (GIConv) -1 ) 60 { 61 return NULL; 62 } 61 63 if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 ) 62 64 { 63 return NULL; 64 } 65 if( ( test = g_convert_with_iconv( " ", 1, oc, NULL, &test_bytes, NULL ) ) == NULL || 66 test_bytes > 1 ) 67 { 68 g_free( test ); 69 g_iconv_close( oc ); 70 irc_usermsg( irc, "Unsupported character set: The IRC protocol " 71 "only supports 8-bit character sets." ); 72 return NULL; 73 } 74 if( ( ic = g_iconv_open( "utf-8", value ) ) == (GIConv) -1 ) 75 { 76 g_iconv_close( oc ); 65 g_iconv_close( ic ); 77 66 return NULL; 78 67 } … … 89 78 } 90 79 91 static char *set_eval_away_status( set_t *set, char *value )92 {93 irc_t *irc = set->data;94 account_t *a;95 96 g_free( set->value );97 set->value = g_strdup( value );98 99 for( a = irc->accounts; a; a = a->next )100 {101 struct im_connection *ic = a->ic;102 103 if( ic && ic->flags & OPT_LOGGED_IN )104 imc_away_send_update( ic );105 }106 107 return value;108 }109 110 80 irc_t *irc_new( int fd ) 111 81 { … … 173 143 irc_connection_list = g_slist_append( irc_connection_list, irc ); 174 144 175 s = set_add( &irc->set, "away", NULL, set_eval_away_status, irc );176 s->flags |= SET_NULL_OK;177 145 s = set_add( &irc->set, "away_devoice", "true", set_eval_away_devoice, irc ); 178 146 s = set_add( &irc->set, "auto_connect", "true", set_eval_bool, irc ); 179 s = set_add( &irc->set, "auto_reconnect", " true", set_eval_bool, irc );147 s = set_add( &irc->set, "auto_reconnect", "false", set_eval_bool, irc ); 180 148 s = set_add( &irc->set, "auto_reconnect_delay", "5*3<900", set_eval_account_reconnect_delay, irc ); 181 149 s = set_add( &irc->set, "buddy_sendbuffer", "false", set_eval_bool, irc ); 182 150 s = set_add( &irc->set, "buddy_sendbuffer_delay", "200", set_eval_int, irc ); 183 151 s = set_add( &irc->set, "charset", "utf-8", set_eval_charset, irc ); 184 s = set_add( &irc->set, "control_channel", irc->channel, set_eval_control_channel, irc );185 152 s = set_add( &irc->set, "debug", "false", set_eval_bool, irc ); 186 153 s = set_add( &irc->set, "default_target", "root", NULL, irc ); … … 196 163 s = set_add( &irc->set, "save_on_quit", "true", set_eval_bool, irc ); 197 164 s = set_add( &irc->set, "simulate_netsplit", "true", set_eval_bool, irc ); 198 s = set_add( &irc->set, "status", NULL, set_eval_away_status, irc );199 s->flags |= SET_NULL_OK;200 165 s = set_add( &irc->set, "strip_html", "true", NULL, irc ); 201 s = set_add( &irc->set, "timezone", "local", set_eval_timezone, irc );202 166 s = set_add( &irc->set, "to_char", ": ", set_eval_to_char, irc ); 203 167 s = set_add( &irc->set, "typing_notice", "false", set_eval_bool, irc );
Note: See TracChangeset
for help on using the changeset viewer.