diff options
author | Kim Alvefur <zash@zash.se> | 2020-11-30 21:00:45 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-11-30 21:00:45 +0100 |
commit | b96341a58f9bcf8829e34b17d766f55a58c3f82d (patch) | |
tree | ff136b8f603e3460fa13fb93f9ecd45a4d9e4d01 /plugins/mod_mam | |
parent | f4208459a70ad45794af44c54a7de2e2785ef9e9 (diff) | |
download | prosody-b96341a58f9bcf8829e34b17d766f55a58c3f82d.tar.gz prosody-b96341a58f9bcf8829e34b17d766f55a58c3f82d.zip |
mod_mam: Advertise extended MAM 0.7.x behind a feature flag
In order to ease testing until the extended feautres are all
implemented.
Also TODOs for all the sub-features.
Diffstat (limited to 'plugins/mod_mam')
-rw-r--r-- | plugins/mod_mam/mod_mam.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua index dd498fdd..cc7b7fba 100644 --- a/plugins/mod_mam/mod_mam.lua +++ b/plugins/mod_mam/mod_mam.lua @@ -1,7 +1,7 @@ -- Prosody IM -- Copyright (C) 2008-2017 Matthew Wild -- Copyright (C) 2008-2017 Waqas Hussain --- Copyright (C) 2011-2017 Kim Alvefur +-- Copyright (C) 2011-2020 Kim Alvefur -- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. @@ -10,6 +10,7 @@ -- local xmlns_mam = "urn:xmpp:mam:2"; +local xmlns_mam_ext = "urn:xmpp:mam:2#extended"; local xmlns_delay = "urn:xmpp:delay"; local xmlns_forward = "urn:xmpp:forward:0"; local xmlns_st_id = "urn:xmpp:sid:0"; @@ -512,8 +513,18 @@ module:hook("pre-message/full", c2s_message_handler, 0); module:hook("message/bare", message_handler, 0); module:hook("message/full", message_handler, 0); +local advertise_extended = module:get_option_boolean("mam_advertise_extend", false); +-- TODO before-id, after-id +-- TODO ids +-- TODO page flipping +-- TODO archive metadata query +-- TODO delete feature flag option + module:hook("account-disco-info", function(event) (event.reply or event.stanza):tag("feature", {var=xmlns_mam}):up(); + if advertise_extended then + (event.reply or event.stanza):tag("feature", {var=xmlns_mam_ext}):up(); + end (event.reply or event.stanza):tag("feature", {var=xmlns_st_id}):up(); end); |