300 scr_LogPrint(LPRINT_NORMAL, "Can not remove global coloring mode"); |
300 scr_LogPrint(LPRINT_NORMAL, "Can not remove global coloring mode"); |
301 } |
301 } |
302 g_free(muclow); |
302 g_free(muclow); |
303 } else {//Add or overwrite |
303 } else {//Add or overwrite |
304 if (strcmp(muc, "*")) { |
304 if (strcmp(muc, "*")) { |
305 ensure_string_htable(&muccolors, g_free); |
|
306 muccoltype *value = g_new(muccoltype, 1); |
305 muccoltype *value = g_new(muccoltype, 1); |
307 *value = type; |
306 *value = type; |
|
307 ensure_string_htable(&muccolors, g_free); |
308 g_hash_table_replace(muccolors, muclow, value); |
308 g_hash_table_replace(muccolors, muclow, value); |
309 } else { |
309 } else { |
310 glob_muccol = type; |
310 glob_muccol = type; |
311 g_free(muclow); |
311 g_free(muclow); |
312 } |
312 } |
1093 // Make sure we are at the right position |
1093 // Make sure we are at the right position |
1094 wmove(win_entry->win, n, prefixwidth-1); |
1094 wmove(win_entry->win, n, prefixwidth-1); |
1095 |
1095 |
1096 // The MUC nick - overwrite with proper color |
1096 // The MUC nick - overwrite with proper color |
1097 if (line->mucnicklen) { |
1097 if (line->mucnicklen) { |
|
1098 char *mucjid; |
|
1099 char tmp; |
|
1100 nickcolor *actual = NULL; |
|
1101 muccoltype type, *typetmp; |
|
1102 |
1098 // Store the char after the nick |
1103 // Store the char after the nick |
1099 char tmp = line->text[line->mucnicklen]; |
1104 tmp = line->text[line->mucnicklen]; |
1100 muccoltype type = glob_muccol, *typetmp; |
1105 type = glob_muccol; |
1101 // Terminate the string after the nick |
1106 // Terminate the string after the nick |
1102 line->text[line->mucnicklen] = '\0'; |
1107 line->text[line->mucnicklen] = '\0'; |
1103 char *mucjid = g_utf8_strdown(CURRENT_JID, -1); |
1108 mucjid = g_utf8_strdown(CURRENT_JID, -1); |
1104 if (muccolors) { |
1109 if (muccolors) { |
1105 typetmp = g_hash_table_lookup(muccolors, mucjid); |
1110 typetmp = g_hash_table_lookup(muccolors, mucjid); |
1106 if (typetmp) |
1111 if (typetmp) |
1107 type = *typetmp; |
1112 type = *typetmp; |
1108 } |
1113 } |
1109 g_free(mucjid); |
1114 g_free(mucjid); |
1110 nickcolor *actual = NULL; |
|
1111 // Need to generate some random color? |
1115 // Need to generate some random color? |
1112 if ((type == MC_ALL) && (!nickcolors || |
1116 if ((type == MC_ALL) && (!nickcolors || |
1113 !g_hash_table_lookup(nickcolors, line->text))) { |
1117 !g_hash_table_lookup(nickcolors, line->text))) { |
|
1118 char *snick, *mnick; |
|
1119 nickcolor *nc; |
|
1120 snick = g_strdup(line->text); |
|
1121 mnick = g_strdup(line->text); |
|
1122 nc = g_new(nickcolor, 1); |
1114 ensure_string_htable(&nickcolors, NULL); |
1123 ensure_string_htable(&nickcolors, NULL); |
1115 char *snick = g_strdup(line->text), *mnick = g_strdup(line->text); |
|
1116 nickcolor *nc = g_new(nickcolor, 1); |
|
1117 nc->color = nickcols[random() % nickcolcount]; |
1124 nc->color = nickcols[random() % nickcolcount]; |
1118 nc->manual = FALSE; |
1125 nc->manual = FALSE; |
1119 *snick = '<'; |
1126 *snick = '<'; |
1120 snick[strlen(snick)-1] = '>'; |
1127 snick[strlen(snick)-1] = '>'; |
1121 *mnick = '*'; |
1128 *mnick = '*'; |