~emersion/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH] Do not panic if BouncerServ command without handler is sent

Details
Message ID
<20200609113928.29688-1-fox.cpp@disroot.org>
DKIM signature
pass
Download raw message
Patch: +14 -0
---
 service.go | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/service.go b/service.go
index 1aab5e5..c7faa8c 100644
--- a/service.go
+++ b/service.go
@@ -71,6 +71,20 @@ func handleServicePRIVMSG(dc *downstreamConn, text string) {
		return
	}

	if cmd.handle == nil {
		if len(cmd.children) > 0 {
			var l []string
			appendServiceCommandSetHelp(cmd.children, words, &l)
			sendServicePRIVMSG(dc, "available commands: "+strings.Join(l, ", "))
		} else {
			// Pretend the command does not exist if it has neither children nor handler.
			// This is obviously a bug but it is better to not die anyway.
			dc.logger.Printf("command without handler and subcommands invoked:", words[0])
			sendServicePRIVMSG(dc, fmt.Sprintf("command %q not found", words[0]))
		}
		return
	}

	if err := cmd.handle(dc, params); err != nil {
		sendServicePRIVMSG(dc, fmt.Sprintf("error: %v", err))
	}
-- 
2.27.0
Details
Message ID
<81391d312f34b6c9eeebb06883552a4f@disroot.org>
In-Reply-To
<20200609113928.29688-1-fox.cpp@disroot.org> (view parent)
DKIM signature
pass
Download raw message
Woops, I forgot to include this in Subject. It is a patch for soju.
Details
Message ID
<yKBkaH183fh_1Efhaxw_dlQexHmZlZKEb4n4uNoOIvDmBPiIwfuK9hU9EwIetUcBsDWIQcaWA0rTCBn93mQnKU1f0vDHTtlLNBJYH1m2SnM=@emersion.fr>
In-Reply-To
<20200609113928.29688-1-fox.cpp@disroot.org> (view parent)
DKIM signature
pass
Download raw message
Pushed, thanks!
Review patch Export thread (mbox)