Changeset 7a9d968 for nick.c


Ignore:
Timestamp:
2018-03-10T11:30:39Z (6 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Children:
5447c59
Parents:
3f44e43 (diff), 4a9c6b0 (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.
Message:

Merge branch 'master' into HEAD

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nick.c

    r3f44e43 r7a9d968  
    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 = irc ? set_getbool(&irc->b->set, "nick_underscores") : FALSE;
    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.