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).
This commit is contained in:
Simon Ser 2022-03-08 16:45:45 +01:00
parent 421d3f258a
commit 2060ae05cf

View File

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