Add NO_ACT level

This patch adds a new NO_ACT level that can be used with /ignore to
ignore activity notifications
This commit is contained in:
Tom Feist 2014-01-09 15:23:47 +01:00 committed by Ailin Nemui
commit 7d87a02522
2 changed files with 47 additions and 7 deletions

View file

@ -46,6 +46,7 @@ static const char *levels[] = {
"HILIGHTS",
"NOHILIGHT",
"NO_ACT",
NULL
};
@ -59,6 +60,9 @@ int level_get(const char *level)
if (g_ascii_strcasecmp(level, "NEVER") == 0)
return MSGLEVEL_NEVER;
if (g_ascii_strcasecmp(level, "NO_ACT") == 0)
return MSGLEVEL_NO_ACT;
len = strlen(level);
if (len == 0) return 0;
@ -139,6 +143,9 @@ char *bits2level(int bits)
if (bits & MSGLEVEL_NEVER)
g_string_append(str, "NEVER ");
if (bits & MSGLEVEL_NO_ACT)
g_string_append(str, "NO_ACT ");
for (n = 0; levels[n] != NULL; n++) {
if (bits & (1L << n))
g_string_append_printf(str, "%s ", levels[n]);