Better MAM fin RSM logging

This commit is contained in:
Bohdan Horbeshko 2025-08-18 00:22:08 -04:00
parent 983c0102a4
commit 7463a56a7d

View file

@ -2533,6 +2533,7 @@ func handleSetQueryMAM2(s xmpp.Sender, iq *stanza.IQ, query *extensions.MAM2Quer
if beyond { if beyond {
count := 0 count := 0
rs.Count = &count rs.Count = &count
log.Debugf("MAM: beyond")
} else { } else {
if len(messages) > 0 { if len(messages) > 0 {
if fromStart { if fromStart {
@ -2575,7 +2576,14 @@ func handleSetQueryMAM2(s xmpp.Sender, iq *stanza.IQ, query *extensions.MAM2Quer
rs.Last = &last rs.Last = &last
} }
} }
log.Debugf("MAM fin: %#v", answer.Payload) if log.GetLevel() == log.DebugLevel {
xmlFin, err := xml.Marshal(answer.Payload)
if err == nil {
log.Debug(string(xmlFin))
} else {
log.Debugf("MAM fin: %#v %#v", answer.Payload, rs)
}
}
} }
func iqAnswerSetError(answer *stanza.IQ, code int) { func iqAnswerSetError(answer *stanza.IQ, code int) {