message: safeguard _handle_receipt_received

This shouldnt be necessary since we check for the receipt outside
alreayd. Let's be on the safe side though in case code gets changed
later.
This commit is contained in:
Michael Vetter
2021-03-25 11:54:59 +01:00
parent 9cfe5ec787
commit e396e863dd

View File

@@ -1131,6 +1131,7 @@ static void
_handle_receipt_received(xmpp_stanza_t* const stanza) _handle_receipt_received(xmpp_stanza_t* const stanza)
{ {
xmpp_stanza_t* receipt = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_RECEIPTS); xmpp_stanza_t* receipt = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_RECEIPTS);
if (receipt) {
const char* name = xmpp_stanza_get_name(receipt); const char* name = xmpp_stanza_get_name(receipt);
if (g_strcmp0(name, "received") != 0) { if (g_strcmp0(name, "received") != 0) {
return; return;
@@ -1150,6 +1151,7 @@ _handle_receipt_received(xmpp_stanza_t* const stanza)
sv_ev_message_receipt(jidp->barejid, id); sv_ev_message_receipt(jidp->barejid, id);
jid_destroy(jidp); jid_destroy(jidp);
} }
}
static void static void
_receipt_request_handler(xmpp_stanza_t* const stanza) _receipt_request_handler(xmpp_stanza_t* const stanza)