downstream: only send CHATHISTORY ISUPPORT when supported

This commit is contained in:
Simon Ser 2023-02-02 19:36:18 +01:00
parent a331d2368a
commit b4731cbd71

View File

@ -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)
}