aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/ircbot/Sourcehut
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: update webhook to handle applied patchesRobin Jarry2024-06-281-20/+72
| | | | | | | | | | | 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-281-2/+2
| | | | | | | | 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-141-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-016-0/+120
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>