~emersion/soju-dev

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

[PATCH] Return an empty CHATHISTORY TARGETS batch when in multi-upstream

Details
Message ID
<20211115182017.4900-1-delthas@dille.cc>
DKIM signature
pass
Download raw message
Patch: +6 -0
When on an unbound bouncer network downstream, we should return no
targets (there are none, because there are no upstreams at all).

When on a multi-upstream downstream, we should return no targets as we
don't support multi-upstream CHATHISTORY TARGETS.

Before this patch, we returned a misleading error message:
:example.com 403 :Missing network suffix in name
---
 downstream.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/downstream.go b/downstream.go
index 16e8413..39ecd6e 100644
--- a/downstream.go
+++ b/downstream.go
@@ -2359,6 +2359,12 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
				return err
			}
		case "TARGETS":
			if dc.network == nil {
				// Either an unbound bouncer network, in which case we should return no targets,
				// or a multi-upstream downstream, but we don't support CHATHISTORY TARGETS for those yet.
				dc.SendBatch("draft/chathistory-targets", nil, nil, func(batchRef irc.TagValue) {})
				return nil
			}
			if err := parseMessageParams(msg, nil, &boundsStr[0], &boundsStr[1], &limitStr); err != nil {
				return err
			}
-- 
2.17.1
Details
Message ID
<gz-GAlbpXsYUCW8jO71PJmO9NAnw_fL4ZmjA4UJMuCMsCmR3Yeg1q3MA3Gxt6m4azVFhUX99vTwiQOxdP7-hiTEuxWqgjdRUAS_P-UKNrLQ=@emersion.fr>
In-Reply-To
<20211115182017.4900-1-delthas@dille.cc> (view parent)
DKIM signature
pass
Download raw message
LGTM and pushed, thanks!
Reply to thread Export thread (mbox)