From 8971f6edaeb5a6f3c08a3b00354ea15eb0707359 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Fri, 28 Jul 2023 21:06:31 +0200 Subject: contrib: actually fix irc patchset hook when author is not registered 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 --- contrib/ircbot/Sourcehut/plugin.py | 4 ++-- contrib/ircbot/install-webhook.sh | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'contrib') diff --git a/contrib/ircbot/Sourcehut/plugin.py b/contrib/ircbot/Sourcehut/plugin.py index 50128d79..33026ee1 100644 --- a/contrib/ircbot/Sourcehut/plugin.py +++ b/contrib/ircbot/Sourcehut/plugin.py @@ -62,9 +62,9 @@ class SourcehutServerCallback(httpserver.SupyHTTPServerCallback): submitter = patchset["submitter"]["canonicalName"] except KeyError: try: - submitter = patchset["submitter"]["username"] + submitter = patchset["submitter"]["name"] except KeyError: - submitter = patchset["submitter"]["email"] + submitter = patchset["submitter"]["address"] msg = f"received {bold(subject)} from {italic(submitter)}: {underline(url)}" self.plugin.announce(channel, msg) handler.send_response(200) diff --git a/contrib/ircbot/install-webhook.sh b/contrib/ircbot/install-webhook.sh index 3c0c5bcb..1f8f12dd 100755 --- a/contrib/ircbot/install-webhook.sh +++ b/contrib/ircbot/install-webhook.sh @@ -27,8 +27,10 @@ query { submitter { ... on User { canonicalName - username - email + } + ... on Mailbox { + name + address } } } -- cgit