Diff

mod_http_muc_log/mod_http_muc_log.lua @ 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
parent 4963:479d618c9e6d
child 4986:3bcefa9cf1ca
line wrap: on
line diff
--- 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;