From b4731cbd716a4c8b73fca40f6bb1f7b7c8d113b9 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 2 Feb 2023 19:36:18 +0100 Subject: [PATCH] downstream: only send CHATHISTORY ISUPPORT when supported --- downstream.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/downstream.go b/downstream.go index 3ba1968..dc87372 100644 --- a/downstream.go +++ b/downstream.go @@ -1463,7 +1463,6 @@ func (dc *downstreamConn) welcome(ctx context.Context) error { dc.nickCM = casemapASCII(dc.nick) isupport := []string{ - fmt.Sprintf("CHATHISTORY=%v", chatHistoryLimit), "CASEMAPPING=ascii", } @@ -1479,6 +1478,9 @@ func (dc *downstreamConn) welcome(ctx context.Context) error { isupport = append(isupport, "WHOX") isupport = append(isupport, "CHANTYPES=") // channels are not supported } + if _, ok := dc.user.msgStore.(msgstore.ChatHistoryStore); ok && dc.network != nil { + isupport = append(isupport, fmt.Sprintf("CHATHISTORY=%v", chatHistoryLimit)) + } if dc.caps.IsEnabled("soju.im/webpush") { isupport = append(isupport, "VAPID="+dc.srv.webPush.VAPIDKeys.Public) }