Implement urgency flag matcher
Currently it supports the following options: "oldest": match the first window that triggered an urgent event "latest": match the last window that triggered an urgent event
This commit is contained in:
committed by
Michael Stapelberg
parent
23abfcf7f2
commit
53541817ef
docs
include
parser-specs
src
@ -307,6 +307,19 @@ char *cmd_criteria_add(Match *current_match, char *ctype, char *cvalue) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (strcmp(ctype, "urgent") == 0) {
|
||||
if (strcasecmp(cvalue, "latest") == 0 ||
|
||||
strcasecmp(cvalue, "newest") == 0 ||
|
||||
strcasecmp(cvalue, "recent") == 0 ||
|
||||
strcasecmp(cvalue, "last") == 0) {
|
||||
current_match->urgent = U_LATEST;
|
||||
} else if (strcasecmp(cvalue, "oldest") == 0 ||
|
||||
strcasecmp(cvalue, "first") == 0) {
|
||||
current_match->urgent = U_OLDEST;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ELOG("Unknown criterion: %s\n", ctype);
|
||||
|
||||
/* This command is internal and does not generate a JSON reply. */
|
||||
|
Reference in New Issue
Block a user