From 2060ae05cf6e301dd38e9a916c8dcfa81de04674 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 8 Mar 2022 16:45:45 +0100 Subject: [PATCH] downstream: drop delivery receipts when client supports chathistory When the client supports draft/chathistory, no need to request delivery receipts via PING messages. Let's just not leave delivery receipts alone. They'll go stale but should be never used (or used by a non-chathistory client). --- downstream.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/downstream.go b/downstream.go index 9f018d3..16d725b 100644 --- a/downstream.go +++ b/downstream.go @@ -596,7 +596,7 @@ func (dc *downstreamConn) SendBatch(typ string, params []string, tags irc.Tags, func (dc *downstreamConn) sendMessageWithID(msg *irc.Message, id string) { dc.SendMessage(msg) - if id == "" || !dc.messageSupportsBacklog(msg) { + if id == "" || !dc.messageSupportsBacklog(msg) || dc.caps["draft/chathistory"] { return } @@ -607,7 +607,7 @@ func (dc *downstreamConn) sendMessageWithID(msg *irc.Message, id string) { // sending a message. This is useful e.g. for self-messages when echo-message // isn't enabled. func (dc *downstreamConn) advanceMessageWithID(msg *irc.Message, id string) { - if id == "" || !dc.messageSupportsBacklog(msg) { + if id == "" || !dc.messageSupportsBacklog(msg) || dc.caps["draft/chathistory"] { return }