1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge pull request #1869 from profanity-im/fix/1868-mam

Fix crash if we don't get `first` stanza during RSM
This commit is contained in:
Michael Vetter 2023-07-18 16:45:40 +02:00 committed by GitHub
commit 69d8c1f96e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 20 deletions

View File

@ -135,6 +135,16 @@
</xmpp:SupportedXep>
</implements>
<!-- XEP-0059: Result Set Management -->
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource='https://xmpp.org/extensions/xep-0059.html'/>
<xmpp:status>complete</xmpp:status>
<xmpp:version>1.0</xmpp:version>
<xmpp:since>DEV</xmpp:since>
</xmpp:SupportedXep>
</implements>
<!-- XEP-0060: Publish-Subscribe -->
<implements>
<xmpp:SupportedXep>

View File

@ -2738,6 +2738,7 @@ _mam_rsm_id_handler(xmpp_stanza_t* const stanza, void* const userdata)
auto_char char* firstid = NULL;
xmpp_stanza_t* first = xmpp_stanza_get_child_by_name(set, STANZA_NAME_FIRST);
if (first) {
firstid = xmpp_stanza_get_text(first);
// 4.3.2. send same stanza with set,max stanza
@ -2764,6 +2765,7 @@ _mam_rsm_id_handler(xmpp_stanza_t* const stanza, void* const userdata)
}
}
}
}
return 0;
}