+else if (parse_identifier(filter, CUS "notify_method_capability"))
+ {
+ /*
+ notify_method_capability = "notify_method_capability" [COMPARATOR] [MATCH-TYPE]
+ <notification-uri: string>
+ <notification-capability: string>
+ <key-list: string-list>
+ */
+
+ int m;
+ int co = 0, mt = 0;
+
+ enum Comparator comparator = COMP_EN_ASCII_CASEMAP;
+ enum MatchType matchType = MATCH_IS;
+ gstring uri, capa, *keys;
+
+ if (!filter->require_enotify)
+ {
+ filter->errmsg = CUS "missing previous require \"enotify\";";
+ return -1;
+ }
+ for (;;)
+ {
+ if (parse_white(filter) == -1) return -1;
+ if ((m = parse_comparator(filter, &comparator)) != 0)
+ {
+ if (m == -1) return -1;
+ if (co)
+ {
+ filter->errmsg = CUS "comparator already specified";
+ return -1;
+ }
+ else co = 1;
+ }
+ else if ((m = parse_matchtype(filter, &matchType)) != 0)
+ {
+ if (m == -1) return -1;
+ if (mt)
+ {
+ filter->errmsg = CUS "match type already specified";
+ return -1;
+ }
+ else mt = 1;
+ }
+ else break;
+ }
+ if ((m = parse_string(filter, &uri)) != 1)
+ {
+ if (m == 0) filter->errmsg = CUS "missing notification URI string";
+ return -1;
+ }
+ if (parse_white(filter) == -1)
+ return -1;
+ if ((m = parse_string(filter, &capa)) != 1)
+ {
+ if (m == 0) filter->errmsg = CUS "missing notification capability string";
+ return -1;
+ }
+ if (parse_white(filter) == -1)
+ return -1;
+ if ((m = parse_stringlist(filter, &keys)) != 1)
+ {
+ if (m == 0) filter->errmsg = CUS "missing key string list";
+ return -1;
+ }
+ if (exec)
+ {
+ string_item * recipient = NULL;
+ gstring header = { .s = NULL, .ptr = -1 };
+ gstring subject = { .s = NULL, .ptr = -1 };
+ gstring body = { .s = NULL, .ptr = -1 };
+
+ *cond = 0;
+ if (parse_mailto_uri(filter, uri.s, &recipient, &header, &subject, &body) == 1)
+ if (eq_asciicase(&capa, &str_online, FALSE) == 1)
+ for (gstring * k = keys; k->ptr != -1; ++k)
+ {
+ *cond = compare(filter, k, &str_maybe, comparator, matchType);
+ if (*cond == -1) return -1;
+ if (*cond) break;
+ }
+ }
+ return 1;
+ }