- Timestamp:
- 2010-07-18T23:50:27Z (14 years ago)
- Branches:
- master
- Children:
- 5a61bf59
- Parents:
- 94d5da9c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r94d5da9c r6d8cc05 33 33 static char *set_eval_charset( set_t *set, char *value ); 34 34 static char *set_eval_password( set_t *set, char *value ); 35 static char *set_eval_bw_compat( set_t *set, char *value ); 35 36 36 37 irc_t *irc_new( int fd ) … … 101 102 102 103 s = set_add( &b->set, "allow_takeover", "true", set_eval_bool, irc ); 103 s = set_add( &b->set, "away_devoice", "true", set_eval_ away_devoice, irc );104 s = set_add( &b->set, "away_devoice", "true", set_eval_bw_compat, irc ); 104 105 s = set_add( &b->set, "away_reply_timeout", "3600", set_eval_int, irc ); 105 106 s = set_add( &b->set, "charset", "utf-8", set_eval_charset, irc ); … … 121 122 s = set_add( &b->set, "query_order", "lifo", NULL, irc ); 122 123 s = set_add( &b->set, "root_nick", ROOT_NICK, set_eval_root_nick, irc ); 124 s = set_add( &b->set, "show_offline", "false", set_eval_bw_compat, irc ); 123 125 s = set_add( &b->set, "simulate_netsplit", "true", set_eval_bool, irc ); 124 126 s = set_add( &b->set, "timezone", "local", set_eval_timezone, irc ); … … 901 903 } 902 904 903 char *set_eval_away_devoice( set_t *set, char *value ) 905 /* Mostly meant for upgrades. If one of these is set to the non-default, 906 set show_users of all channels to something with the same effect. */ 907 static char *set_eval_bw_compat( set_t *set, char *value ) 904 908 { 905 909 irc_t *irc = set->data; 906 907 if( !is_bool( value ) ) 910 char *val; 911 GSList *l; 912 913 irc_usermsg( irc, "Setting `%s' is obsolete, use the `show_users' " 914 "channel setting instead.", set->key ); 915 916 if( strcmp( set->key, "away_devoice" ) == 0 && !bool2int( value ) ) 917 val = "online,away"; 918 else if( strcmp( set->key, "show_offline" ) == 0 && bool2int( value ) ) 919 val = "online@,away+,offline"; 920 else 908 921 return SET_INVALID; 909 922 910 /* The usual problem: The setting isn't actually changed at this 911 point and we need it to be, so do it by hand. */ 912 g_free( set->value ); 913 set->value = g_strdup( value ); 914 915 bee_irc_channel_update( irc, NULL, NULL ); 916 917 return value; 918 } 923 for( l = irc->channels; l; l = l->next ) 924 { 925 irc_channel_t *ic = l->data; 926 /* No need to check channel type, if the setting doesn't exist it 927 will just be ignored. */ 928 set_setstr( &ic->set, "show_users", val ); 929 } 930 931 return SET_INVALID; 932 }
Note: See TracChangeset
for help on using the changeset viewer.