1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

Don't expand ALL when combined with NEVER/NO_ACT

This commit is contained in:
David Leadbeater 2014-06-29 20:13:49 +01:00
parent 819f9d16c9
commit d84811b192

View File

@ -136,19 +136,25 @@ char *bits2level(int bits)
if (bits == 0)
return g_strdup("");
if (bits == MSGLEVEL_ALL)
return g_strdup("ALL");
str = g_string_new(NULL);
if (bits & MSGLEVEL_NEVER)
if (bits & MSGLEVEL_NEVER) {
g_string_append(str, "NEVER ");
bits &= ~MSGLEVEL_NEVER;
}
if (bits & MSGLEVEL_NO_ACT)
if (bits & MSGLEVEL_NO_ACT) {
g_string_append(str, "NO_ACT ");
bits &= ~MSGLEVEL_NO_ACT;
}
for (n = 0; levels[n] != NULL; n++) {
if (bits & (1L << n))
g_string_append_printf(str, "%s ", levels[n]);
if (bits == MSGLEVEL_ALL) {
g_string_append(str, "ALL ");
} else {
for (n = 0; levels[n] != NULL; n++) {
if (bits & (1L << n))
g_string_append_printf(str, "%s ", levels[n]);
}
}
if (str->len > 0)
g_string_truncate(str, str->len-1);