Software /
code /
prosody-modules
Comparison
mod_pubsub_stats/mod_pubsub_stats.lua @ 3175:44c5d7310c33
mod_pubsub_stats: Pass configuration to disable persistence and limit number of items
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 08 Jul 2018 01:17:23 +0200 |
parent | 3160:330e8c81f6af |
child | 3407:26ae3b6a8a57 |
comparison
equal
deleted
inserted
replaced
3174:f02c0f5e44ac | 3175:44c5d7310c33 |
---|---|
24 module:log("error", "Error publishing stats: %s", err); | 24 module:log("error", "Error publishing stats: %s", err); |
25 end | 25 end |
26 end | 26 end |
27 | 27 |
28 function module.load() | 28 function module.load() |
29 pubsub.service:create(node, true); | 29 pubsub.service:create(node, true, { |
30 persistent_items = false; | |
31 max_items = 1; | |
32 }); | |
30 pubsub.service:set_affiliation(node, true, actor, "publisher"); | 33 pubsub.service:set_affiliation(node, true, actor, "publisher"); |
31 end | 34 end |
32 | 35 |
33 module:hook_global("stats-updated", function (event) | 36 module:hook_global("stats-updated", function (event) |
34 publish_stats(event.stats, event.stats_extra); | 37 publish_stats(event.stats, event.stats_extra); |