Software /
code /
prosody-modules
Comparison
mod_mam/mamprefs.lib.lua @ 2509:34ec7bde5203
mod_mam: Add annotations [luacheck]
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 20 Feb 2017 00:06:28 +0100 |
parent | 2017:d44ac0756c46 |
child | 2510:d81882aa0e1e |
comparison
equal
deleted
inserted
replaced
2508:03f6d9ed2903 | 2509:34ec7bde5203 |
---|---|
1 -- XEP-0313: Message Archive Management for Prosody | 1 -- XEP-0313: Message Archive Management for Prosody |
2 -- Copyright (C) 2011-2013 Kim Alvefur | 2 -- Copyright (C) 2011-2013 Kim Alvefur |
3 -- | 3 -- |
4 -- This file is MIT/X11 licensed. | 4 -- This file is MIT/X11 licensed. |
5 -- luacheck: ignore 122/prosody | |
5 | 6 |
6 local global_default_policy = module:get_option("default_archive_policy", true); | 7 local global_default_policy = module:get_option("default_archive_policy", true); |
7 | 8 |
8 do | 9 do |
10 -- luacheck: ignore 211/prefs_format | |
9 local prefs_format = { | 11 local prefs_format = { |
10 [false] = "roster", | 12 [false] = "roster", |
11 -- default ::= true | false | "roster" | 13 -- default ::= true | false | "roster" |
12 -- true = always, false = never, nil = global default | 14 -- true = always, false = never, nil = global default |
13 ["romeo@montague.net"] = true, -- always | 15 ["romeo@montague.net"] = true, -- always |
14 ["montague@montague.net"] = false, -- newer | 16 ["montague@montague.net"] = false, -- newer |
15 }; | 17 }; |
16 end | 18 end |
17 | 19 |
18 local sessions = hosts[module.host].sessions; | 20 local sessions = prosody.hosts[module.host].sessions; |
19 local prefs = module:open_store("archive2_prefs"); | 21 local prefs = module:open_store("archive2_prefs"); |
20 | 22 |
21 local function get_prefs(user) | 23 local function get_prefs(user) |
22 local user_sessions = sessions[user]; | 24 local user_sessions = sessions[user]; |
23 local user_prefs = user_sessions and user_sessions.archive_prefs | 25 local user_prefs = user_sessions and user_sessions.archive_prefs |