Changeset 1522faf for irc_channel.c


Ignore:
Timestamp:
2015-04-06T02:26:44Z (10 years ago)
Author:
dequis <dx@…>
Children:
d16e951
Parents:
71f87ba (diff), 69982f8 (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.
git-author:
dequis <dx@…> (06-04-15 02:24:35)
git-committer:
dequis <dx@…> (06-04-15 02:26:44)
Message:

Merge branch 'develop' into feat/hip-cat

Conflicts:

irc_im.c
protocols/jabber/conference.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_channel.c

    r71f87ba r1522faf  
    588588char *irc_channel_name_gen(bee_t *bee, const char *hint)
    589589{
    590         char name[MAX_NICK_LENGTH + 1] = { 0 };
    591 
    592         name[0] = '#';
    593         strncpy(name + 1, hint, MAX_NICK_LENGTH - 1);
    594         name[MAX_NICK_LENGTH] = '\0';
     590        char *name, *final_name;
     591        gsize bytes_written;
     592
     593        name = g_convert_with_fallback(hint, -1, "ASCII//TRANSLIT", "UTF-8", "", NULL, &bytes_written, NULL);
     594        if (bytes_written > MAX_NICK_LENGTH) {
     595                name[MAX_NICK_LENGTH] = '\0';
     596        }
    595597
    596598        irc_channel_name_strip(name);
    597599
    598600        if (set_getbool(&bee->set, "lcnicks")) {
    599                 nick_lc(bee->ui_data, name + 1);
     601                nick_lc(bee->ui_data, name);
    600602        }
    601603
     
    604606        }
    605607
    606         return g_strdup(name);
     608        final_name = g_strconcat("#", name, NULL);
     609
     610        g_free(name);
     611
     612        return final_name;
    607613}
    608614
Note: See TracChangeset for help on using the changeset viewer.