diff options
author | Markus K?tter <koetter@rrzn-hiwi.uni-hannover.de> | 2012-04-13 21:23:26 +0200 |
---|---|---|
committer | Markus K?tter <koetter@rrzn-hiwi.uni-hannover.de> | 2012-04-13 21:23:26 +0200 |
commit | 66d1101545dc3b6981ad2a7f45e6b719829d030e (patch) | |
tree | 91164b8ca0023698d6197b0a2a3f3036078f3ed3 /plugins/muc/mod_muc.lua | |
parent | 9b41a236b0162a863c8417119795481814eb3c01 (diff) | |
download | prosody-66d1101545dc3b6981ad2a7f45e6b719829d030e.tar.gz prosody-66d1101545dc3b6981ad2a7f45e6b719829d030e.zip |
muc - implement per channel history limits
- allow configuration via channel settings
- store the settings for permanent channels
- honor muc max_history_messages from the config as upper limit
- only broadcast_message with historic = true if history_length is > 0
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-rw-r--r-- | plugins/muc/mod_muc.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index 8ef7a5b3..43b8423d 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -69,10 +69,10 @@ for jid in pairs(persistent_rooms) do local node = jid_split(jid); local data = datamanager.load(node, muc_host, "config") or {}; local room = muc_new_room(jid, { - history_length = max_history_messages; + max_history_length = max_history_messages; }); room._data = data._data; - room._data.history_length = max_history_messages; --TODO: Need to allow per-room with a global limit + room._data.max_history_length = max_history_messages; -- Overwrite old max_history_length in data with current settings room._affiliations = data._affiliations; room.route_stanza = room_route_stanza; room.save = room_save; @@ -80,7 +80,7 @@ for jid in pairs(persistent_rooms) do end local host_room = muc_new_room(muc_host, { - history_length = max_history_messages; + max_history_length = max_history_messages; }); host_room.route_stanza = room_route_stanza; host_room.save = room_save; @@ -131,7 +131,7 @@ function stanza_handler(event) (restrict_room_creation == "admin" and is_admin(stanza.attr.from)) or (restrict_room_creation == "local" and select(2, jid_split(stanza.attr.from)) == module.host:gsub("^[^%.]+%.", "")) then room = muc_new_room(bare, { - history_length = max_history_messages; + max_history_length = max_history_messages; }); room.route_stanza = room_route_stanza; room.save = room_save; |