Software /
code /
prosody
Comparison
plugins/mod_mam/mod_mam.lua @ 11281:142fb655b885
mod_mam: Advertise extended MAM when archive storage is capable
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 12 Jan 2021 19:25:29 +0100 |
parent | 11280:e35e98541ca0 |
child | 11337:f89c8e6beaa6 |
comparison
equal
deleted
inserted
replaced
11280:e35e98541ca0 | 11281:142fb655b885 |
---|---|
565 module:hook("pre-message/full", c2s_message_handler, 0); | 565 module:hook("pre-message/full", c2s_message_handler, 0); |
566 -- Stanzas to local clients | 566 -- Stanzas to local clients |
567 module:hook("message/bare", message_handler, 0); | 567 module:hook("message/bare", message_handler, 0); |
568 module:hook("message/full", message_handler, 0); | 568 module:hook("message/full", message_handler, 0); |
569 | 569 |
570 local advertise_extended = module:get_option_boolean("mam_advertise_extend", false); | 570 local advertise_extended = archive.caps and archive.caps.full_id_range and archive.caps.ids; |
571 -- TODO delete feature flag option | |
572 | 571 |
573 module:hook("account-disco-info", function(event) | 572 module:hook("account-disco-info", function(event) |
574 (event.reply or event.stanza):tag("feature", {var=xmlns_mam}):up(); | 573 (event.reply or event.stanza):tag("feature", {var=xmlns_mam}):up(); |
575 if advertise_extended then | 574 if advertise_extended then |
576 (event.reply or event.stanza):tag("feature", {var=xmlns_mam_ext}):up(); | 575 (event.reply or event.stanza):tag("feature", {var=xmlns_mam_ext}):up(); |