Changeset 90254d0


Ignore:
Timestamp:
2016-12-26T00:18:55Z (7 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
df291a6
Parents:
0483e1e
git-author:
dequis <dx@…> (24-12-16 04:56:45)
git-committer:
dequis <dx@…> (26-12-16 00:18:55)
Message:

Add nick_lowercase and nick_underscores settings

Files:
4 edited

Legend:

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

    r0483e1e r90254d0  
    10371037        </bitlbee-setting>
    10381038
    1039         <bitlbee-setting name="lcnicks" type="boolean" scope="global">
    1040                 <default>true</default>
    1041 
    1042                 <description>
    1043                         <para>
    1044                                 Hereby you can change whether you want all lower case nick names or leave the case as it intended by your peer.
    1045                         </para>
    1046                 </description>
    1047 
    1048         </bitlbee-setting>
    1049 
    10501039        <bitlbee-setting name="local_display_name" type="boolean" scope="account">
    10511040                <default>false</default>
     
    12121201                        </para>
    12131202                </description>
     1203        </bitlbee-setting>
     1204
     1205        <bitlbee-setting name="nick_lowercase" type="boolean" scope="global">
     1206                <default>true</default>
     1207
     1208                <description>
     1209                        <para>
     1210                                If enabled, all nicknames are turned into lower case.
     1211                        </para>
     1212
     1213                        <para>
     1214                                See also the <emphasis>nick_underscores</emphasis> setting. This setting was previously known as <emphasis>lcnicks</emphasis>.
     1215                        </para>
     1216                </description>
     1217
     1218        </bitlbee-setting>
     1219
     1220        <bitlbee-setting name="nick_underscores" type="boolean" scope="global">
     1221                <default>true</default>
     1222
     1223                <description>
     1224                        <para>
     1225                                If enabled, spaces in nicknames are turned into underscores instead of being stripped.
     1226                        </para>
     1227
     1228                        <para>
     1229                                See also the <emphasis>nick_lowercase</emphasis> setting.
     1230                        </para>
     1231                </description>
     1232
    12141233        </bitlbee-setting>
    12151234
  • irc.c

    r0483e1e r90254d0  
    113113        s = set_add(&b->set, "last_version", "0", NULL, irc);
    114114        s->flags |= SET_HIDDEN;
    115         s = set_add(&b->set, "lcnicks", "true", set_eval_bool, irc);
    116115        s = set_add(&b->set, "nick_format", "%-@nick", NULL, irc);
     116        s = set_add(&b->set, "nick_lowercase", "false", set_eval_bool, irc);
     117        s = set_add(&b->set, "nick_underscores", "false", set_eval_bool, irc);
    117118        s = set_add(&b->set, "offline_user_quits", "true", set_eval_bool, irc);
    118119        s = set_add(&b->set, "ops", "both", set_eval_irc_channel_ops, irc);
  • irc_channel.c

    r0483e1e r90254d0  
    638638        irc_channel_name_strip(name);
    639639
    640         if (set_getbool(&irc->b->set, "lcnicks")) {
     640        if (set_getbool(&irc->b->set, "nick_lowercase")) {
    641641                nick_lc(irc, name + 1);
    642642        }
  • nick.c

    r0483e1e r90254d0  
    9494
    9595                nick_strip(irc, nick);
    96                 if (set_getbool(&bu->bee->set, "lcnicks")) {
     96                if (set_getbool(&bu->bee->set, "nick_lowercase")) {
    9797                        nick_lc(irc, nick);
    9898                }
     
    215215        if (ok && rets && *rets) {
    216216                nick_strip(irc, rets);
     217
     218                if (set_getbool(&bu->bee->set, "nick_lowercase")) {
     219                        nick_lc(irc, rets);
     220                }
     221
    217222                truncate_utf8(rets, MAX_NICK_LENGTH);
    218223                return rets;
     
    288293{
    289294        int len = 0;
     295        gboolean nick_underscores = set_getbool(&irc->b->set, "nick_underscores");
    290296
    291297        if (irc && (irc->status & IRC_UTF8_NICKS)) {
     
    297303                        n = g_utf8_find_next_char(p, NULL);
    298304
    299                         if ((c < 0x7f && !(strchr(nick_lc_chars, c) ||
    300                                            strchr(nick_uc_chars, c))) ||
     305                        if (nick_underscores && c == ' ') {
     306                                *p = '_';
     307                                p = n;
     308                        } else if ((c < 0x7f && !(strchr(nick_lc_chars, c) ||
     309                                                  strchr(nick_uc_chars, c))) ||
    301310                            !g_unichar_isgraph(c)) {
    302311                                strcpy(tmp, n);
     
    313322
    314323                for (i = len = 0; nick[i] && len < MAX_NICK_LENGTH; i++) {
    315                         if (strchr(nick_lc_chars, nick[i]) ||
     324                        if (nick_underscores && nick[i] == ' ') {
     325                                nick[len] = '_';
     326                                len++;
     327                        } else if (strchr(nick_lc_chars, nick[i]) ||
    316328                            strchr(nick_uc_chars, nick[i])) {
    317329                                nick[len] = nick[i];
Note: See TracChangeset for help on using the changeset viewer.