aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/ircbot
Commit message (Collapse)AuthorAgeFilesLines
* ircbot: sanitize email subjectsRobin Jarry2024-08-201-3/+5
| | | | | | | | | Email subjects may contain line breaks if they are too long to fit in 72 columns. The supybot library does not support sending messages with line breaks. It raises an error. Replace all consecutive "white space" characters (including \r and \n) with regular space characters. Signed-off-by: Robin Jarry <robin@jarry.cc>
* ircbot: wait random delay before un-flipping tablesRobin Jarry2024-07-021-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unflipping tables instantly is not very considerate and certainly does not have the same emotional impact compared to waiting for a moment to digest the table flipping. Wait for a random period of time using a log normal distribution: | # | # # | # # | # # | # # | # # # | # # # # | # # # # | # # # # # | # # # # # # | # # # # # # # | # # # # # # # # | # # # # # # # # # # # # | # # # # # # # # # # # # # # # # . . . +----------------------------------------------------- 0 1 2 3 4 5 6 7 8 delay(seconds) Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
* ircbot: implement table unflippingRobin Jarry2024-06-281-0/+6
| | | | | | | | Some IRC users have a tendency to flip tables when they are upset. Improve our bot to put furniture back where it belongs. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* ircbot: improve karma pluginRobin Jarry2024-06-281-14/+23
| | | | | | | Handle NICK++ and NICK-- in the middle of sentences. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* ircbot: import upstream karma pluginRobin Jarry2024-06-283-0/+578
| | | | | | | | | Just a copy of the upstream code verbatim. I'll patch the plugin in the next commits. Link: https://github.com/progval/Limnoria/tree/a6aa553/plugins/Karma Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* ircbot: use tabs for nginx configRobin Jarry2024-06-281-25/+25
| | | | | | | Who indents nginx config files with 8 spaces? Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* ircbot: update nginx config after sourcehut migrationRobin Jarry2024-06-281-3/+2
| | | | | | | | Since January 2024, Sourcehut infra has moved to the EU. Their IP block was changed. Update our nginx config accordingly. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* ircbot: update webhook to handle applied patchesRobin Jarry2024-06-282-23/+102
| | | | | | | | | | | Register another webhook for all received emails and track the X-Sourcehut-Patchset-Update header value. If it is APPLIED, then send an IRC announce accordingly. Use green for "applied" and light gr{e,a}y for "received". Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* contrib: actually fix irc patchset hook when author is not registeredRobin Jarry2023-07-282-4/+6
| | | | | | | | When the author is not registered in sr.ht, the schema object is different. Fixes: 3a73ffb40ed1 ("contrib: fix irc patchset hook when author is not registered") Signed-off-by: Robin Jarry <robin@jarry.cc>
* contrib: fix irc patchset hook when author is not registeredRobin Jarry2023-07-142-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid running into KeyError because the webhook payload does not have a submitter canonicalName field. { "data": { "webhook": { "uuid": "69635b8e-8af5-4292-866b-1e45f75c132a", "event": "PATCHSET_RECEIVED", "date": "2023-07-11T13:55:17.248351983Z", "patchset": { "id": 42569, "subject": "Commands: add :echo command", "version": 1, "prefix": "aerc", "list": { "name": "aerc-devel", "owner": { "canonicalName": "~rjarry" } }, "submitter": {} } } } } Add username and email as fallback values. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Bence Ferdinandy <bence@ferdinandy.com>
* contrib: add irc bot stuffRobin Jarry2023-07-0110-0/+251
Add a small script to install a sourcehut webhook that triggers on patchset reception. Add a limnoria (supybot fork) plugin to receive the webhook requests and send IRC NOTICE messages on the proper channels. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Bence Ferdinandy <bence@ferdinandy.com>