# HG changeset patch # User Kim Alvefur # Date 1753468418 -7200 # Node ID 598359d9f580bc1bc125df6ba6686046f940e735 # Parent 7761360ffb7b3cfa4fde3f08fcd12f6717af1562 mod_csi_simple: Consider own PEP event broadcasts as high priority This should help keep ones own clients in sync, e.g. with XEP-0490 Check for delivery errors earlier in order to avoid misinterpreting payloads echoed back along with errors. diff -r 7761360ffb7b -r 598359d9f580 plugins/mod_csi_simple.lua --- a/plugins/mod_csi_simple.lua Tue Jul 22 16:34:56 2025 +0100 +++ b/plugins/mod_csi_simple.lua Fri Jul 25 20:33:38 2025 +0200 @@ -11,6 +11,7 @@ local dt = require "prosody.util.datetime"; local filters = require "prosody.util.filters"; local timer = require "prosody.util.timer"; +local jid_bare = require "prosody.util.jid".bare; local queue_size = module:get_option_integer("csi_queue_size", 256, 1); local resume_delay = module:get_option_period("csi_resume_inactive_delay", 5); @@ -40,13 +41,18 @@ -- TODO Some MUC awareness, e.g. check for the 'this relates to you' status code return true, "subscription request"; elseif st_name == "message" then + if st_type == "error" then + return true, "delivery failure"; + end + if stanza:get_child("event", "http://jabber.org/protocol/pubsub#event") then + if stanza.attr.from == nil or stanza.attr.from == jid_bare(stanza.attr.to) then + return true, "self-pep-event"; + end + end if st_type == "headline" then -- Headline messages are ephemeral by definition return false, "headline"; end - if st_type == "error" then - return true, "delivery failure"; - end if stanza:get_child("sent", "urn:xmpp:carbons:2") then return true, "carbon"; end