From 3469a51f5896ef96b2e53d61fcfd2163b92ad11a Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Fri, 13 Sep 2024 20:50:00 +0200 Subject: [PATCH] mod_pubsub: Don't blindly echo PEP notification Since commit 514c25caef8dac65761075e1ce7d8118d34809d0, whenever a PEP item was published, a notification was blindly sent back to the owner. However, this should only be done subject to +notify filtering, as per XEP-0163: | the PEP service shall send notifications to all of the account owner's | available resources (subject to notification filtering). The motivation for the mentioned commit was that +notify subscriptions initially didn't work for PEP node owners (#2108). However, that issue was fixed by commit 5968bc9318bec80aef1c31d46d247c13bdbc4c0e (#2112). As a result, the owner's client was actually notified twice if the client was subscribed to the node (e.g., via +notify). Therefore, just omit the additional, blind notification. Thanks to W. Martin Borgert and Daniel Gultsch for reporting the issue. --- src/mod_pubsub.erl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index 650f59684fb..9fe4ce949f7 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -3052,9 +3052,7 @@ broadcast_stanza({LUser, LServer, LResource}, Publisher, Node, Nidx, Type, NodeO extended_headers([Publisher])), Pred = fun(To) -> delivery_permitted(Owner, To, NodeOptions) end, ejabberd_sm:route(jid:make(LUser, LServer, SenderResource), - {pep_message, <<((Node))/binary, "+notify">>, Stanza, Pred}), - ejabberd_router:route(xmpp:set_to(xmpp:put_meta(Stanza, ignore_sm_bounce, true), - jid:make(LUser, LServer))); + {pep_message, <<((Node))/binary, "+notify">>, Stanza, Pred}); broadcast_stanza(Host, _Publisher, Node, Nidx, Type, NodeOptions, SubsByDepth, NotifyType, BaseStanza, SHIM) -> broadcast_stanza(Host, Node, Nidx, Type, NodeOptions, SubsByDepth, NotifyType, BaseStanza, SHIM).