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...
--- 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;