aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_presence.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-03-19 00:10:15 +0100
committerKim Alvefur <zash@zash.se>2020-03-19 00:10:15 +0100
commitc0b0c818027d7070e7d1539a31e5d9fce2cb9f73 (patch)
treeb01f34206833b6b7f6c1971e9c24f6fbe2cee6e4 /plugins/mod_presence.lua
parentb816830a99f237f89de8160eb2dc8f6808a05d6f (diff)
downloadprosody-c0b0c818027d7070e7d1539a31e5d9fce2cb9f73.tar.gz
prosody-c0b0c818027d7070e7d1539a31e5d9fce2cb9f73.zip
mod_presence: Advertise support for Subscription Pre-Approval
RFC 6121 ยง3.4 says: > If a server supports subscription pre-approvals, then it MUST > advertise the following stream feature during stream negotiation. The feature itself (#686) was added in f0e9e5bda415
Diffstat (limited to 'plugins/mod_presence.lua')
-rw-r--r--plugins/mod_presence.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index e69c31a5..d6e2b2b7 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -30,6 +30,14 @@ local recalc_resource_map = require "util.presence".recalc_resource_map;
local ignore_presence_priority = module:get_option_boolean("ignore_presence_priority", false);
+local pre_approval_stream_feature = st.stanza("sub", {xmlns="urn:xmpp:features:pre-approval"});
+module:hook("stream-features", function(event)
+ local origin, features = event.origin, event.features;
+ if origin.username then
+ features:add_child(pre_approval_stream_feature);
+ end
+end);
+
function handle_normal_presence(origin, stanza)
if ignore_presence_priority then
local priority = stanza:get_child("priority");