- Timestamp:
- 2010-06-05T23:21:02Z (15 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r3ab1d31 rb308cf9 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 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 59 79 if( ( ic = g_iconv_open( "utf-8", value ) ) == (GIConv) -1 ) 60 80 { 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 ); 66 82 return NULL; 67 83 } … … 109 125 sock_make_nonblocking( irc->fd ); 110 126 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 ); 112 128 113 129 irc->status = USTATUS_OFFLINE; … … 175 191 s = set_add( &irc->set, "default_target", "root", NULL, irc ); 176 192 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 ); 177 194 s = set_add( &irc->set, "handle_unknown", "root", NULL, irc ); 178 195 s = set_add( &irc->set, "lcnicks", "true", set_eval_bool, irc ); … … 184 201 s = set_add( &irc->set, "root_nick", irc->mynick, set_eval_root_nick, irc ); 185 202 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 ); 186 204 s = set_add( &irc->set, "simulate_netsplit", "true", set_eval_bool, irc ); 187 205 s = set_add( &irc->set, "status", NULL, set_eval_away_status, irc ); 188 206 s->flags |= SET_NULL_OK; 189 207 s = set_add( &irc->set, "strip_html", "true", NULL, irc ); 208 s = set_add( &irc->set, "timezone", "local", set_eval_timezone, irc ); 190 209 s = set_add( &irc->set, "to_char", ": ", set_eval_to_char, irc ); 191 210 s = set_add( &irc->set, "typing_notice", "false", set_eval_bool, irc ); … … 195 214 /* Evaluator sets the iconv/oconv structures. */ 196 215 set_eval_charset( set_find( &irc->set, "charset" ), set_getstr( &irc->set, "charset" ) ); 216 217 nogaim_init(); 197 218 198 219 return( irc ); … … 677 698 in the event queue. */ 678 699 /* 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 ) ) */ 680 701 681 702 /* 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 ); 683 704 } 684 705 … … 706 727 if( now ) 707 728 { 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 ); 709 730 } 710 731 temp = temp->next;
Note: See TracChangeset
for help on using the changeset viewer.