From 025051505b2f4860e05fea34bedc0d33ea96c676 Mon Sep 17 00:00:00 2001 From: "jabber.developer2" Date: Thu, 21 May 2026 12:30:56 +0300 Subject: [PATCH] fix(receipts): request receipts when capabilities unknown (upstream 4749645c7) When the receipts-request preference is on but we have no cached EntityCapabilities for the recipient (new session, bare-jid only, disco not finished), the previous check via caps_jid_has_feature() defaulted to 'not supported' and silently suppressed the receipt. Per XEP-0184 we should send the receipt request unless we have positive knowledge that the peer does not advertise the feature. Restore that behaviour: look up caps with caps_lookup(); only flip request_receipt off when caps are present AND the feature is missing from the list. If caps are NULL, leave the request enabled (falls back to the user preference). --- src/event/client_events.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/event/client_events.c b/src/event/client_events.c index 16ae8b78..8ebefa6e 100644 --- a/src/event/client_events.c +++ b/src/event/client_events.c @@ -115,7 +115,12 @@ cl_ev_send_msg_correct(ProfChatWin* chatwin, const char* const msg, const char* gboolean request_receipt = prefs_get_boolean(PREF_RECEIPTS_REQUEST); if (request_receipt) { auto_char char* jid = chat_session_get_jid(chatwin->barejid); - request_receipt = caps_jid_has_feature(jid, XMPP_FEATURE_RECEIPTS); + EntityCapabilities* caps = caps_lookup(jid); + if (caps != NULL) { + GSList* found = g_slist_find_custom(caps->features, XMPP_FEATURE_RECEIPTS, (GCompareFunc)g_strcmp0); + request_receipt = (found != NULL); + caps_destroy(caps); + } } auto_char char* plugin_msg = plugins_pre_chat_message_send(chatwin->barejid, msg);