# HG changeset patch # User Kim Alvefur # Date 1606766445 -3600 # Node ID e3f6f0b39e7b0a8dc25110ce5c6d139918ef7f78 # Parent 97077089f3c2aad4a80af7901ace20180cf4f808 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. diff -r 97077089f3c2 -r e3f6f0b39e7b doc/doap.xml --- a/doc/doap.xml Tue Jan 12 19:19:15 2021 +0100 +++ b/doc/doap.xml Mon Nov 30 21:00:45 2020 +0100 @@ -568,7 +568,8 @@ - 0.6.3 + 0.7.2 + partial 0.10.0 mod_mam, mod_muc_mam diff -r 97077089f3c2 -r e3f6f0b39e7b plugins/mod_mam/mod_mam.lua --- a/plugins/mod_mam/mod_mam.lua Tue Jan 12 19:19:15 2021 +0100 +++ b/plugins/mod_mam/mod_mam.lua Mon Nov 30 21:00:45 2020 +0100 @@ -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("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); diff -r 97077089f3c2 -r e3f6f0b39e7b spec/scansion/mam_extended.scs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spec/scansion/mam_extended.scs Mon Nov 30 21:00:45 2020 +0100 @@ -0,0 +1,78 @@ +# MAM 0.7.x Extended features + +[Client] Romeo + jid: extmamtester@localhost + password: password + +--------- + +Romeo connects + +# Enable MAM so we can save some messages +Romeo sends: + + + + + + + +Romeo receives: + + + + + + + +# Some messages to look for later +Romeo sends: + + Hello + + +Romeo sends: + + U there? + + +Romeo sends: + + + + +Romeo receives: + + + + + + Hello + + + + + +Romeo receives: + + + + + + U there? + + + + + +# FIXME unstable tag order from util.rsm +Romeo receives: + + + + 2 + + + + +