--- a/mcabber/src/screen.c Sun Aug 31 12:20:54 2008 +0200
+++ b/mcabber/src/screen.c Sun Aug 31 17:40:00 2008 +0200
@@ -1101,16 +1101,20 @@
type = *typetmp;
}
g_free(mucjid);
- // Need to generate some random color?
+ // Need to generate a color for the specified nick?
if ((type == MC_ALL) && (!nickcolors ||
!g_hash_table_lookup(nickcolors, line->text))) {
char *snick, *mnick;
nickcolor *nc;
+ const char *p = line->text;
+ unsigned int nicksum = 0;
snick = g_strdup(line->text);
mnick = g_strdup(line->text);
nc = g_new(nickcolor, 1);
ensure_string_htable(&nickcolors, NULL);
- nc->color = nickcols[random() % nickcolcount];
+ while (*p)
+ nicksum += *p++;
+ nc->color = nickcols[nicksum % nickcolcount];
nc->manual = FALSE;
*snick = '<';
snick[strlen(snick)-1] = '>';