diff options
author | TingPing <tngpng@gmail.com> | 2013-03-24 01:53:37 -0700 |
---|---|---|
committer | TingPing <tngpng@gmail.com> | 2013-03-24 01:53:37 -0700 |
commit | a5994cf647819f452dce400426d47f2fca52a69b (patch) | |
tree | 226e31e7f4c8ee80c5309d7619c1e9140b741c97 /src/common | |
parent | b693c58e9f978a3f708784d50869c8420451fcf1 (diff) | |
parent | 44b381680fb9b35e3c8685fa5438dfba5d5e050d (diff) |
Merge pull request #445 from TingPing/ulistcolors
Add option to color nicknames in the userlist to match the chat
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/cfgfiles.c | 1 | ||||
-rw-r--r-- | src/common/hexchat.h | 1 | ||||
-rw-r--r-- | src/common/text.c | 6 | ||||
-rw-r--r-- | src/common/text.h | 1 |
4 files changed, 6 insertions, 3 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index 5ea6d42c..cca2267a 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -465,6 +465,7 @@ const struct prefs vars[] = {"gui_tray_minimize", P_OFFINT (hex_gui_tray_minimize), TYPE_BOOL}, {"gui_tray_quiet", P_OFFINT (hex_gui_tray_quiet), TYPE_BOOL}, {"gui_ulist_buttons", P_OFFINT (hex_gui_ulist_buttons), TYPE_BOOL}, + {"gui_ulist_color", P_OFFINT (hex_gui_ulist_color), TYPE_BOOL}, {"gui_ulist_count", P_OFFINT (hex_gui_ulist_count), TYPE_BOOL}, {"gui_ulist_doubleclick", P_OFFSET (hex_gui_ulist_doubleclick), TYPE_STR}, {"gui_ulist_hide", P_OFFINT (hex_gui_ulist_hide), TYPE_BOOL}, diff --git a/src/common/hexchat.h b/src/common/hexchat.h index 8e459306..e234c976 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -157,6 +157,7 @@ struct hexchatprefs unsigned int hex_gui_tray_minimize; unsigned int hex_gui_tray_quiet; unsigned int hex_gui_ulist_buttons; + unsigned int hex_gui_ulist_color; unsigned int hex_gui_ulist_count; unsigned int hex_gui_ulist_hide; unsigned int hex_gui_ulist_icons; diff --git a/src/common/text.c b/src/common/text.c index 33ef3c9e..8196cc03 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -2006,8 +2006,8 @@ pevt_build_string (const char *input, char **output, int *max_arg) static char rcolors[] = { 19, 20, 22, 24, 25, 26, 27, 28, 29 }; -static int -color_of (char *name) +int +text_color_of (char *name) { int i = 0, sum = 0; @@ -2030,7 +2030,7 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d) if (prefs.hex_text_color_nicks && (index == XP_TE_CHANACTION || index == XP_TE_CHANMSG)) { - snprintf (tbuf, sizeof (tbuf), "\003%d%s", color_of (a), a); + snprintf (tbuf, sizeof (tbuf), "\003%d%s", text_color_of (a), a); a = tbuf; stripcolor_args &= ~ARG_FLAG(1); /* don't strip color from this argument */ } diff --git a/src/common/text.h b/src/common/text.h index c3adb885..103e294d 100644 --- a/src/common/text.h +++ b/src/common/text.h @@ -26,6 +26,7 @@ void pevent_save (char *fn); int pevt_build_string (const char *input, char **output, int *max_arg); int pevent_load (char *filename); void pevent_make_pntevts (void); +int text_color_of (char *name); void text_emit (int index, session *sess, char *a, char *b, char *c, char *d); int text_emit_by_name (char *name, session *sess, char *a, char *b, char *c, char *d); char *text_validate (char **text, int *len); |