Mercurial > prosody-modules
comparison mod_mam/mod_mam.lua @ 1788:d2b82b90c413
mod_mam: Unindent 'else' block
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 26 Aug 2015 17:22:14 +0200 |
parents | fb2b9a2e2316 |
children | 4c2146f5bf39 |
comparison
equal
deleted
inserted
replaced
1787:663e5d923ef0 | 1788:d2b82b90c413 |
---|---|
199 local prefs = get_prefs(user); | 199 local prefs = get_prefs(user); |
200 local rule = prefs[who]; | 200 local rule = prefs[who]; |
201 module:log("debug", "%s's rule for %s is %s", user, who, tostring(rule)); | 201 module:log("debug", "%s's rule for %s is %s", user, who, tostring(rule)); |
202 if rule ~= nil then | 202 if rule ~= nil then |
203 return rule; | 203 return rule; |
204 else -- Below could be done by a metatable | 204 end |
205 local default = prefs[false]; | 205 -- Below could be done by a metatable |
206 module:log("debug", "%s's default rule is %s", user, tostring(default)); | 206 local default = prefs[false]; |
207 if default == nil then | 207 module:log("debug", "%s's default rule is %s", user, tostring(default)); |
208 default = global_default_policy; | 208 if default == nil then |
209 module:log("debug", "Using global default rule, %s", tostring(default)); | 209 default = global_default_policy; |
210 end | 210 module:log("debug", "Using global default rule, %s", tostring(default)); |
211 if default == "roster" then | 211 end |
212 return has_in_roster(user, who); | 212 if default == "roster" then |
213 end | 213 return has_in_roster(user, who); |
214 return default; | 214 end |
215 end | 215 return default; |
216 end | 216 end |
217 | 217 |
218 -- Handle messages | 218 -- Handle messages |
219 local function message_handler(event, c2s) | 219 local function message_handler(event, c2s) |
220 local origin, stanza = event.origin, event.stanza; | 220 local origin, stanza = event.origin, event.stanza; |