aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-01-10 22:15:55 +0100
committerKim Alvefur <zash@zash.se>2022-01-10 22:15:55 +0100
commitba50691289cdca1eb574e3e6231ec27d50c2ce67 (patch)
tree7e403f8ef34d770f82f6ac83140be56481cf6059 /plugins
parentbdd8dddff5161776e864f6a82ab47dab162c6f38 (diff)
downloadprosody-ba50691289cdca1eb574e3e6231ec27d50c2ce67.tar.gz
prosody-ba50691289cdca1eb574e3e6231ec27d50c2ce67.zip
mod_bookmarks: Block publishing to older XEP-0402 v0.3.0 node
Having both the :0 and :1 nodes would be especially awkward, since there is no upgrade path for this case. In theory, these should be rare since no clients should have been doing XEP-0402 unless mod_bookmarks(2) was enabled. This was guesstimated to be rare with most clients doing XEP-0048 with Private XML.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_bookmarks.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/mod_bookmarks.lua b/plugins/mod_bookmarks.lua
index fc37f09a..1e89053a 100644
--- a/plugins/mod_bookmarks.lua
+++ b/plugins/mod_bookmarks.lua
@@ -10,6 +10,7 @@ local mod_pep = module:depends "pep";
local private_storage = module:open_store("private", "map");
local namespace = "urn:xmpp:bookmarks:1";
+local namespace_old = "urn:xmpp:bookmarks:0";
local namespace_private = "jabber:iq:private";
local namespace_legacy = "storage:bookmarks";
local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
@@ -271,7 +272,13 @@ local function on_publish_legacy_pep(event)
end
local publish = pubsub:get_child("publish");
- if publish == nil or publish.attr.node ~= namespace_legacy then
+ if publish == nil then return end
+ if publish.attr.node == namespace_old then
+ session.send(st.error_reply(stanza, "modify", "not-allowed",
+ "Your client does XEP-0402 version 0.3.0 but 0.4.0+ is required"));
+ return true;
+ end
+ if publish.attr.node ~= namespace_legacy then
return;
end