Changeset

4970:8c7b7db69f5b

mod_http_muc_log: Drop support for pre-0.11 MUC API The oldest supported Prosody branch is 0.11, therefore we can drop code for the MUC API of Prosody 0.10 and before. The module:shared("rooms") method was never even in a release...
author Kim Alvefur <zash@zash.se>
date Sat, 02 Jul 2022 02:30:02 +0200
parents 4969:889e1695e935
children 4971:bc78424968b2
files mod_http_muc_log/README.markdown mod_http_muc_log/mod_http_muc_log.lua
diffstat 2 files changed, 4 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_muc_log/README.markdown	Sat Jul 02 02:30:06 2022 +0200
+++ b/mod_http_muc_log/README.markdown	Sat Jul 02 02:30:02 2022 +0200
@@ -103,6 +103,6 @@
 Compatibility
 =============
 
-Requires Prosody 0.10 or above and a storage backend with support for
+Requires Prosody 0.11 or later and a storage backend with support for
 stanza archives. See [mod\_storage\_muc\_log] for using legacy data from
 [mod\_muc\_log].
--- a/mod_http_muc_log/mod_http_muc_log.lua	Sat Jul 02 02:30:06 2022 +0200
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Sat Jul 02 02:30:02 2022 +0200
@@ -2,7 +2,6 @@
 local datetime = require"util.datetime";
 local jid_split = require"util.jid".split;
 local nodeprep = require"util.encodings".stringprep.nodeprep;
-local it = require"util.iterators";
 local url = require"socket.url";
 local os_time, os_date = os.time, os.date;
 local httplib = require "util.http";
@@ -11,18 +10,10 @@
 
 local archive = module:open_store("muc_log", "archive");
 
--- Support both old and new MUC code
+-- Prosody 0.11+ MUC API
 local mod_muc = module:depends"muc";
-local rooms = rawget(mod_muc, "rooms");
-local each_room = rawget(mod_muc, "each_room") or function() return it.values(rooms); end;
-local new_muc = not rooms;
-if new_muc then
-	rooms = module:shared"muc/rooms";
-end
-local get_room_from_jid = rawget(mod_muc, "get_room_from_jid") or
-	function (jid)
-		return rooms[jid];
-	end
+local each_room = mod_muc.each_room;
+local get_room_from_jid = mod_muc.get_room_from_jid;
 
 local function get_room(name)
 	local jid = name .. '@' .. module.host;