# HG changeset patch # User Michal 'vorner' Vaner # Date 1188304604 -7200 # Node ID 7a0eaa53bd53976d87efdc09498a0803e5887539 # Parent 33cb828282d5ca8a4c423287543cfe37de3a1fad Further nick colors fixes (right length computation with different locale than utf-8, proper loading of colors on startup) diff -r 33cb828282d5 -r 7a0eaa53bd53 mcabber/src/screen.c --- a/mcabber/src/screen.c Tue Aug 28 11:24:58 2007 +0200 +++ b/mcabber/src/screen.c Tue Aug 28 14:36:44 2007 +0200 @@ -521,7 +521,7 @@ if (!end) ended = true; *end = '\0'; - int cl = color_to_color_fg(FindColorInternal(ncolors)); + int cl = get_user_color(ncolors); if (cl < 0) { scr_LogPrint(LPRINT_NORMAL, "Unknown color %s", ncolors); } else { @@ -1203,6 +1203,7 @@ int special; guint num_history_blocks; bool setmsgflg = FALSE; + char *nicktmp, *nicklocaltmp; // Look for the window entry. special = (winId == NULL); @@ -1231,6 +1232,14 @@ num_history_blocks = get_max_history_blocks(); text_locale = from_utf8(text); + //Convert the nick alone and compute its length + if (mucnicklen) { + nicktmp = g_strndup(text, mucnicklen); + nicklocaltmp = from_utf8(nicktmp); + mucnicklen = strlen(nicklocaltmp); + g_free(nicklocaltmp); + g_free(nicktmp); + } hbuf_add_line(&win_entry->bd->hbuf, text_locale, timestamp, prefix_flags, maxX - Roster_Width - getprefixwidth(), num_history_blocks, mucnicklen); g_free(text_locale);