Rework formatting of /NAMES and /SCAN output.

The formatting of /NAMES and /SCAN output has been substantially reworked.
The old /FSETs NAMES_BOTCOLOR, NAMES_FRIENDCOLOR, NAMES_NICKCOLOR,
NAMES_OPCOLOR, NAMES_SHITCOLOR and NAMES_VOICECOLOR have been replaced
with these new /FSETs:

....................NAMES_NICK %B$[10]0
................NAMES_NICK_BOT %G$[10]0
.............NAMES_NICK_FRIEND %Y$[10]0
.................NAMES_NICK_ME %W$[10]0
...............NAMES_NICK_SHIT %R$[10]0
....................NAMES_USER %K[ %n$1-%K]
.............NAMES_USER_CHANOP %K[%C$0%n$1-%K]
..............NAMES_USER_IRCOP %K[%R$0%n$1-%K]
..............NAMES_USER_VOICE %K[%M$0%n$1-%K]

The NAMES_NICK formats control how the nick itself is displayed, depending
on the status of the nick as recognised by BitchX (the priority order is
NAMES_NICK_ME > NAMES_NICK_BOT > NAMES_NICK_FRIEND > NAMES_NICK_SHIT >
NAMES_NICK).  The NAMES_USER formats control how the overall entry appears in
the /NAMES or /SCAN line, depending on the channel status of the nick (the
priority order is NAMES_USER_CHANOP > NAMES_USER_VOICE > NAMES_USER_IRCOP >
NAMES_USER).

You'll need to update any scripts or custom formats that altered the old
formats.  If you just use the defaults, the main difference you'll see is
that your own nick is now shown in white, and voiced users are shown with
the '+' sent by the server instead of the 'v'.  You can go back to the old
look by setting these formats:

/FSET NAMES_NICK_ME %B$[10]0
/FSET NAMES_USER_VOICE %K[%Mv%n$1-%K]



git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@46 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2008-05-27 04:53:19 +00:00
parent 56a414feb6
commit 1e81f1ed7b
8 changed files with 178 additions and 88 deletions

View File

@@ -206,42 +206,76 @@ void funny_list(char *from, char **ArgList)
reset_display_target();
}
/* print_funny_names
*
* This handles presenting the output of a NAMES reply. It is a cut-down
* version of the /SCAN output formatting.
*/
void print_funny_names(char *line)
{
register char *t;
int count = 0;
char buffer[BIG_BUFFER_SIZE+1];
char special = '\0';
int cols = get_int_var(NAMES_COLUMNS_VAR);
char *t;
int count = 0;
char buffer[BIG_BUFFER_SIZE];
int cols = get_int_var(NAMES_COLUMNS_VAR);
if (!cols)
cols = 1;
if (line && *line)
{
*buffer = 0;
t = next_arg(line, &line);
do {
while (t = next_arg(line, &line)) {
char *nick;
char *nick_format;
char nick_buffer[BIG_BUFFER_SIZE];
if (!count && fget_string_var(FORMAT_NAMES_BANNER_FSET))
strcpy(buffer, convert_output_format(fget_string_var(FORMAT_NAMES_BANNER_FSET), NULL, NULL));
if (*t == '@' || *t == '+' || *t == '~' || *t == '-' || *t == '%')
{
special = *t;
if (special == '+')
strcat(buffer, convert_output_format(fget_string_var(FORMAT_NAMES_VOICECOLOR_FSET),"%c %s", special, ++t));
else
strcat(buffer, convert_output_format(fget_string_var(FORMAT_NAMES_OPCOLOR_FSET),"%c %s", special, ++t));
}
strlcat(buffer, convert_output_format(
fget_string_var(FORMAT_NAMES_BANNER_FSET), NULL, NULL),
sizeof buffer);
/* Seperate the nick and the possible status presets that might
* preceede it. */
nick = t + strspn(t, "@%+~-");
nick_format = fget_string_var(isme(nick) ?
FORMAT_NAMES_NICK_ME_FSET : FORMAT_NAMES_NICK_FSET);
strlcpy(nick_buffer,
convert_output_format(nick_format, "%s", nick),
sizeof nick_buffer);
if (nick != t)
{
char special = *t;
if (special == '+')
strlcat(buffer,
convert_output_format(
fget_string_var(FORMAT_NAMES_USER_VOICE_FSET),
"%c %s", special, nick_buffer), sizeof buffer);
else
strlcat(buffer,
convert_output_format(
fget_string_var(FORMAT_NAMES_USER_CHANOP_FSET),
"%c %s", special, nick_buffer), sizeof buffer);
}
else
strcat(buffer, convert_output_format(fget_string_var(FORMAT_NAMES_NICKCOLOR_FSET), "$ %s", t));
strcat(buffer, space);
if (count++ >= (cols - 1))
strlcat(buffer,
convert_output_format(
fget_string_var(FORMAT_NAMES_USER_FSET), ". %s",
nick_buffer), sizeof buffer);
strlcat(buffer, space, sizeof buffer);
if (++count >= cols)
{
put_it("%s", buffer);
*buffer = 0;
count = 0;
}
} while ((t = next_arg(line, &line)));
}
if (buffer)
if (count)
put_it("%s", buffer);
}
}