comparison mod_blocking/mod_blocking.lua @ 372:000f1d1c6ca5

mod_blocking: Properly initialize the bootstrap privacy storage
author Paul Aurich <paul@darkrain42.org>
date Mon, 02 May 2011 23:14:13 -0700
parents 4986ffe35704
children 80ede103d7a3
comparison
equal deleted inserted replaced
371:c416db434e5b 372:000f1d1c6ca5
5 5
6 module:add_feature("urn:xmpp:blocking"); 6 module:add_feature("urn:xmpp:blocking");
7 7
8 -- Add JID to default privacy list 8 -- Add JID to default privacy list
9 function add_blocked_jid(username, host, jid) 9 function add_blocked_jid(username, host, jid)
10 local privacy_lists = datamanager.load(username, host, "privacy") or {}; 10 local privacy_lists = datamanager.load(username, host, "privacy") or {lists = {}};
11 local default_list_name = privacy_lists.default; 11 local default_list_name = privacy_lists.default;
12 if not default_list_name then 12 if not default_list_name then
13 default_list_name = "blocklist"; 13 default_list_name = "blocklist";
14 privacy_lists.default = default_list_name; 14 privacy_lists.default = default_list_name;
15 end 15 end