Comparison

plugins/muc/mod_muc.lua @ 8702:7e7aa0f770c7

MUC: Abort module loading if unable to get list of persistent rooms from storage (fixes #1091)
author Kim Alvefur <zash@zash.se>
date Wed, 07 Mar 2018 16:01:58 +0100
parent 8025:8a7c4497569a
child 8703:416b8ae3857d
comparison
equal deleted inserted replaced
8590:4b5a00fffb22 8702:7e7aa0f770c7
35 local hosts = prosody.hosts; 35 local hosts = prosody.hosts;
36 36
37 rooms = {}; 37 rooms = {};
38 local rooms = rooms; 38 local rooms = rooms;
39 local persistent_rooms_storage = module:open_store("persistent"); 39 local persistent_rooms_storage = module:open_store("persistent");
40 local persistent_rooms = persistent_rooms_storage:get() or {}; 40 local persistent_rooms, err = persistent_rooms_storage:get();
41 if not persistent_rooms then
42 assert(not err, err);
43 persistent_rooms = {};
44 end
41 local room_configs = module:open_store("config"); 45 local room_configs = module:open_store("config");
42 46
43 -- Configurable options 47 -- Configurable options
44 muclib.set_max_history_length(module:get_option_number("max_history_messages")); 48 muclib.set_max_history_length(module:get_option_number("max_history_messages"));
45 49