Comparison

core/moduleapi.lua @ 5776:bd0ff8ae98a8

Remove all trailing whitespace
author Florian Zeitz <florob@babelmonkeys.de>
date Fri, 09 Aug 2013 17:48:21 +0200
parent 5771:c4ed6680bf8d
child 5825:ac5e05ffc921
comparison
equal deleted inserted replaced
5775:a6c2b8933507 5776:bd0ff8ae98a8
1 -- Prosody IM 1 -- Prosody IM
2 -- Copyright (C) 2008-2012 Matthew Wild 2 -- Copyright (C) 2008-2012 Matthew Wild
3 -- Copyright (C) 2008-2012 Waqas Hussain 3 -- Copyright (C) 2008-2012 Waqas Hussain
4 -- 4 --
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 8
9 local config = require "core.configmanager"; 9 local config = require "core.configmanager";
72 return false; 72 return false;
73 end 73 end
74 function api:has_identity(category, type, name) 74 function api:has_identity(category, type, name)
75 for _, id in ipairs(self:get_host_items("identity")) do 75 for _, id in ipairs(self:get_host_items("identity")) do
76 if id.category == category and id.type == type and id.name == name then 76 if id.category == category and id.type == type and id.name == name then
77 return true; 77 return true;
78 end 78 end
79 end 79 end
80 return false; 80 return false;
81 end 81 end
82 82
250 local value = self:get_option(name, ...); 250 local value = self:get_option(name, ...);
251 251
252 if value == nil then 252 if value == nil then
253 return nil; 253 return nil;
254 end 254 end
255 255
256 if type(value) ~= "table" then 256 if type(value) ~= "table" then
257 return array{ value }; -- Assume any non-list is a single-item list 257 return array{ value }; -- Assume any non-list is a single-item list
258 end 258 end
259 259
260 return array():append(value); -- Clone 260 return array():append(value); -- Clone
261 end 261 end
262 262
263 function api:get_option_set(name, ...) 263 function api:get_option_set(name, ...)
264 local value = self:get_option_array(name, ...); 264 local value = self:get_option_array(name, ...);
265 265
266 if value == nil then 266 if value == nil then
267 return nil; 267 return nil;
268 end 268 end
269 269
270 return set.new(value); 270 return set.new(value);
271 end 271 end
272 272
273 function api:get_option_inherited_set(name, ...) 273 function api:get_option_inherited_set(name, ...)
274 local value = self:get_option_set(name, ...); 274 local value = self:get_option_set(name, ...);