Changes in irc.c [e1720ce:3e57660]
Legend:
- Unmodified
- Added
- Removed
-
irc.c
re1720ce r3e57660 52 52 { 53 53 irc_t *irc = set->data; 54 char *test; 55 gsize test_bytes = 0; 54 56 GIConv ic, oc; 55 57 … … 57 59 value = g_strdup( "utf-8" ); 58 60 61 if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 ) 62 { 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 } 59 74 if( ( ic = g_iconv_open( "utf-8", value ) ) == (GIConv) -1 ) 60 75 { 61 return NULL; 62 } 63 if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 ) 64 { 65 g_iconv_close( ic ); 76 g_iconv_close( oc ); 66 77 return NULL; 67 78 } … … 78 89 } 79 90 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 80 110 irc_t *irc_new( int fd ) 81 111 { … … 143 173 irc_connection_list = g_slist_append( irc_connection_list, irc ); 144 174 175 s = set_add( &irc->set, "away", NULL, set_eval_away_status, irc ); 176 s->flags |= SET_NULL_OK; 145 177 s = set_add( &irc->set, "away_devoice", "true", set_eval_away_devoice, irc ); 146 178 s = set_add( &irc->set, "auto_connect", "true", set_eval_bool, irc ); 147 s = set_add( &irc->set, "auto_reconnect", " false", set_eval_bool, irc );179 s = set_add( &irc->set, "auto_reconnect", "true", set_eval_bool, irc ); 148 180 s = set_add( &irc->set, "auto_reconnect_delay", "5*3<900", set_eval_account_reconnect_delay, irc ); 149 181 s = set_add( &irc->set, "buddy_sendbuffer", "false", set_eval_bool, irc ); 150 182 s = set_add( &irc->set, "buddy_sendbuffer_delay", "200", set_eval_int, irc ); 151 183 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 ); 152 185 s = set_add( &irc->set, "debug", "false", set_eval_bool, irc ); 153 186 s = set_add( &irc->set, "default_target", "root", NULL, irc ); … … 163 196 s = set_add( &irc->set, "save_on_quit", "true", set_eval_bool, irc ); 164 197 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; 165 200 s = set_add( &irc->set, "strip_html", "true", NULL, irc ); 201 s = set_add( &irc->set, "timezone", "local", set_eval_timezone, irc ); 166 202 s = set_add( &irc->set, "to_char", ": ", set_eval_to_char, irc ); 167 203 s = set_add( &irc->set, "typing_notice", "false", set_eval_bool, irc );
Note: See TracChangeset
for help on using the changeset viewer.