- Timestamp:
- 2009-03-12T19:10:06Z (16 years ago)
- Branches:
- master
- Children:
- 673a54c
- Parents:
- 9b55485
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r9b55485 r823de9d 33 33 34 34 static gboolean irc_userping( gpointer _irc, int fd, b_input_condition cond ); 35 static void irc_welcome( irc_t *irc );35 static void irc_welcome( irc_t* irc ); 36 36 37 37 GSList *irc_connection_list = NULL; 38 38 39 static char * passchange( set_t *set, char *value )39 static char *set_eval_password( set_t *set, char *value ) 40 40 { 41 41 irc_t *irc = set->data; 42 42 43 irc_setpass( irc, value ); 44 irc_usermsg( irc, "Password successfully changed" ); 45 return NULL; 43 if( irc->status & USTATUS_IDENTIFIED && value ) 44 { 45 irc_setpass( irc, value ); 46 return NULL; 47 } 48 else 49 { 50 return SET_INVALID; 51 } 46 52 } 47 53 … … 80 86 struct sockaddr_storage sock; 81 87 socklen_t socklen = sizeof( sock ); 88 set_t *s; 82 89 83 90 irc = g_new0( irc_t, 1 ); … … 139 146 irc_connection_list = g_slist_append( irc_connection_list, irc ); 140 147 141 s et_add( &irc->set, "auto_connect", "true", set_eval_bool, irc );142 s et_add( &irc->set, "auto_reconnect", "false", set_eval_bool, irc );143 s et_add( &irc->set, "auto_reconnect_delay", "300", set_eval_int, irc );144 s et_add( &irc->set, "buddy_sendbuffer", "false", set_eval_bool, irc );145 s et_add( &irc->set, "buddy_sendbuffer_delay", "200", set_eval_int, irc );146 s et_add( &irc->set, "charset", "utf-8", set_eval_charset, irc );147 s et_add( &irc->set, "color_encrypted", "true", set_eval_bool, irc );148 s et_add( &irc->set, "debug", "false", set_eval_bool, irc );149 s et_add( &irc->set, "default_target", "root", NULL, irc );150 s et_add( &irc->set, "display_namechanges", "false", set_eval_bool, irc );151 s et_add( &irc->set, "handle_unknown", "root", NULL, irc );152 s et_add( &irc->set, "halfop_buddies", "encrypted", set_eval_halfop_buddies, irc );153 s et_add( &irc->set, "lcnicks", "true", set_eval_bool, irc );154 s et_add( &irc->set, "op_buddies", "trusted", set_eval_op_buddies, irc );155 s et_add( &irc->set, "op_root", "true", set_eval_op_root, irc );156 s et_add( &irc->set, "op_user", "true", set_eval_op_user, irc );157 s et_add( &irc->set, "otr_policy", "opportunistic", set_eval_otr_policy, irc );158 s et_add( &irc->set, "password", NULL, passchange, irc );159 s et_add( &irc->set, "private", "true", set_eval_bool, irc );160 s et_add( &irc->set, "query_order", "lifo", NULL, irc );161 s et_add( &irc->set, "root_nick", irc->mynick, set_eval_root_nick, irc );162 s et_add( &irc->set, "save_on_quit", "true", set_eval_bool, irc );163 s et_add( &irc->set, "simulate_netsplit", "true", set_eval_bool, irc );164 s et_add( &irc->set, "strip_html", "true", NULL, irc );165 s et_add( &irc->set, "to_char", ": ", set_eval_to_char, irc );166 s et_add( &irc->set, "typing_notice", "false", set_eval_bool, irc );167 s et_add( &irc->set, "voice_buddies", "notaway", set_eval_voice_buddies, irc);148 s = set_add( &irc->set, "auto_connect", "true", set_eval_bool, irc ); 149 s = set_add( &irc->set, "auto_reconnect", "false", set_eval_bool, irc ); 150 s = set_add( &irc->set, "auto_reconnect_delay", "5*3<900", set_eval_account_reconnect_delay, irc ); 151 s = set_add( &irc->set, "buddy_sendbuffer", "false", set_eval_bool, irc ); 152 s = set_add( &irc->set, "buddy_sendbuffer_delay", "200", set_eval_int, irc ); 153 s = set_add( &irc->set, "charset", "utf-8", set_eval_charset, irc ); 154 s = set_add( &irc->set, "color_encrypted", "true", set_eval_bool, irc ); 155 s = set_add( &irc->set, "debug", "false", set_eval_bool, irc ); 156 s = set_add( &irc->set, "default_target", "root", NULL, irc ); 157 s = set_add( &irc->set, "display_namechanges", "false", set_eval_bool, irc ); 158 s = set_add( &irc->set, "handle_unknown", "root", NULL, irc ); 159 s = set_add( &irc->set, "halfop_buddies", "encrypted", set_eval_halfop_buddies, irc ); 160 s = set_add( &irc->set, "lcnicks", "true", set_eval_bool, irc ); 161 s = set_add( &irc->set, "op_buddies", "trusted", set_eval_op_buddies, irc ); 162 s = set_add( &irc->set, "op_root", "true", set_eval_op_root, irc ); 163 s = set_add( &irc->set, "otr_policy", "oppurtunistic", set_eval_otr_policy, irc ); 164 s = set_add( &irc->set, "password", NULL, set_eval_password, irc ); 165 s->flags |= SET_NULL_OK; 166 s = set_add( &irc->set, "private", "true", set_eval_bool, irc ); 167 s = set_add( &irc->set, "query_order", "lifo", NULL, irc ); 168 s = set_add( &irc->set, "root_nick", irc->mynick, set_eval_root_nick, irc ); 169 s = set_add( &irc->set, "save_on_quit", "true", set_eval_bool, irc ); 170 s = set_add( &irc->set, "simulate_netsplit", "true", set_eval_bool, irc ); 171 s = set_add( &irc->set, "strip_html", "true", NULL, irc ); 172 s = set_add( &irc->set, "to_char", ": ", set_eval_to_char, irc ); 173 s = set_add( &irc->set, "typing_notice", "false", set_eval_bool, irc ); 174 s = set_add( &irc->set, "voice_buddies", "notaway", set_eval_voice_buddies, irc); 168 175 169 176 conf_loaddefaults( irc ); 170 177 171 178 irc->otr = otr_new(); 172 179 173 180 /* Evaluator sets the iconv/oconv structures. */ 174 181 set_eval_charset( set_find( &irc->set, "charset" ), set_getstr( &irc->set, "charset" ) ); … … 241 248 242 249 if( irc->status & USTATUS_IDENTIFIED && set_getbool( &irc->set, "save_on_quit" ) ) 243 if( storage_save( irc, TRUE ) != STORAGE_OK )250 if( storage_save( irc, NULL, TRUE ) != STORAGE_OK ) 244 251 irc_usermsg( irc, "Error while saving settings!" ); 245 252 … … 322 329 323 330 g_free( irc->last_target ); 324 331 325 332 otr_free(irc->otr); 326 333 327 334 g_free( irc ); 328 335 329 336 if( global.conf->runmode == RUNMODE_INETD || 330 337 global.conf->runmode == RUNMODE_FORKDAEMON ||
Note: See TracChangeset
for help on using the changeset viewer.