diff options
author | June McEnroe <june@causal.agency> | 2020-04-05 11:09:45 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-04-05 11:13:48 -0400 |
commit | 5fce836036bc60d250b73b8883f02184435fb2c8 (patch) | |
tree | 58d7ce04e92926473bcec00bb21a007975afaddf | |
parent | Check unscoop regexps with make test (diff) | |
download | litterbox-5fce836036bc60d250b73b8883f02184435fb2c8.tar.gz litterbox-5fce836036bc60d250b73b8883f02184435fb2c8.zip |
Add unscoop matchers for ban/unban events
The IRC and Textual matchers miss bans mixed with other mode changes, but those are rare.
Diffstat (limited to '')
-rw-r--r-- | unscoop.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/unscoop.c b/unscoop.c index eabb594..2e4d2d8 100644 --- a/unscoop.c +++ b/unscoop.c @@ -70,7 +70,13 @@ static const struct Matcher Catgirl[] = { }, { P1_TIME "([^ ]+) removes the sign in", Topic, { ":time", ":nick" }, - }, + }, { + P1_TIME "([^ ]+) bans [+]b ([^ ]+)", + Ban, { ":time", ":nick", ":target" }, + }, { + P1_TIME "([^ ]+) unbans [-]b ([^ ]+)", + Unban, { ":time", ":nick", ":target" }, + } }; static const struct Matcher Generic[] = { @@ -119,6 +125,12 @@ static const struct Matcher IRC[] = { }, { P2_TAGS P3_ORIGIN "TOPIC [^ ]+( :?(.+))?", Topic, { NULL, ":time", ":nick", ":user", ":host", NULL, ":message" }, + }, { + P2_TAGS P3_ORIGIN "MODE [^ ]+ [+]b+ :?(.+)", + Ban, { NULL, ":time", ":nick", ":user", ":host", ":target" }, + }, { + P2_TAGS P3_ORIGIN "MODE [^ ]+ [-]b+ :?(.+)", + Unban, { NULL, ":time", ":nick", ":user", ":host", ":target" }, }, }; #undef P2_TAGS @@ -154,7 +166,13 @@ static const struct Matcher Textual[] = { }, { P1_TIME "([^ ]+) changed the topic to (.+)", Topic, { ":time", ":nick", ":message" }, - }, + }, { + P1_TIME "([^ ]+) sets mode [+]b+ (.+)", + Ban, { ":time", ":nick", ":target" }, + }, { + P1_TIME "([^ ]+) sets mode [-]b+ (.+)", + Unban, { ":time", ":nick", ":target" }, + } }; #undef P2_USERHOST #undef P2_MESSAGE |