Changeset 6d8cc05


Ignore:
Timestamp:
2010-07-18T23:50:27Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
5a61bf59
Parents:
94d5da9c
Message:

Adding easy migration from old show_offline/away_devoice settings, and
documentation.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • doc/user-guide/commands.xml

    r94d5da9c r6d8cc05  
    518518                                With this option enabled, the root user devoices people when they go away (just away, not offline) and gives the voice back when they come back. You might dislike the voice-floods you'll get if your contact list is huge, so this option can be disabled.
    519519                        </para>
     520                       
     521                        <para>
     522                                Replaced with the <emphasis>show_users</emphasis> setting. See <emphasis>help show_users</emphasis>.
     523                        </para>
    520524                </description>
    521525        </bitlbee-setting>
     
    10401044                        <para>
    10411045                                If enabled causes BitlBee to also show offline users in Channel. Online-users will get op, away-users voice and offline users none of both. This option takes effect as soon as you reconnect.
     1046                        </para>
     1047                       
     1048                        <para>
     1049                                Replaced with the <emphasis>show_users</emphasis> setting. See <emphasis>help show_users</emphasis>.
     1050                        </para>
     1051                </description>
     1052        </bitlbee-setting>
     1053
     1054        <bitlbee-setting name="show_users" type="string" scope="channel">
     1055                <default>online+,away</default>
     1056
     1057                <description>
     1058                        <para>
     1059                                Comma-separated list of statuses of users you want in the channel,
     1060                                and any modes they should have. The following statuses are currently
     1061                                recognised: <emphasis>online</emphasis> (i.e. available, not
     1062                                away), <emphasis>away</emphasis>, and <emphasis>offline</emphasis>.
     1063                        </para>
     1064                       
     1065                        <para>
     1066                                If a status is followed by a valid channel mode character
     1067                                (@, % or +), it will be given to users with that status.
     1068                                For example, <emphasis>online@,away+,offline</emphasis> will
     1069                                show all users in the channel. Online people will
     1070                                have +o, people who are online but away will have +v,
     1071                                and others will have no special modes.
    10421072                        </para>
    10431073                </description>
  • irc.c

    r94d5da9c r6d8cc05  
    3333static char *set_eval_charset( set_t *set, char *value );
    3434static char *set_eval_password( set_t *set, char *value );
     35static char *set_eval_bw_compat( set_t *set, char *value );
    3536
    3637irc_t *irc_new( int fd )
     
    101102       
    102103        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 );
    104105        s = set_add( &b->set, "away_reply_timeout", "3600", set_eval_int, irc );
    105106        s = set_add( &b->set, "charset", "utf-8", set_eval_charset, irc );
     
    121122        s = set_add( &b->set, "query_order", "lifo", NULL, irc );
    122123        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 );
    123125        s = set_add( &b->set, "simulate_netsplit", "true", set_eval_bool, irc );
    124126        s = set_add( &b->set, "timezone", "local", set_eval_timezone, irc );
     
    901903}
    902904
    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. */
     907static char *set_eval_bw_compat( set_t *set, char *value )
    904908{
    905909        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
    908921                return SET_INVALID;
    909922       
    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}
  • protocols/nogaim.h

    r94d5da9c r6d8cc05  
    324324/* Misc. stuff */
    325325char *set_eval_timezone( set_t *set, char *value );
    326 char *set_eval_away_devoice( set_t *set, char *value );
    327326gboolean auto_reconnect( gpointer data, gint fd, b_input_condition cond );
    328327void cancel_auto_reconnect( struct account *a );
Note: See TracChangeset for help on using the changeset viewer.