aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-01-26 01:49:45 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-01-26 01:49:45 +0500
commitea21601ba0ce6c721a8d2197bc0b66f99a5cdb64 (patch)
tree869caf88cc4f12cc58230262c7fef1230971afa8 /plugins
parentf58048700486b518912c1d2e7237f58172a38fa5 (diff)
downloadprosody-ea21601ba0ce6c721a8d2197bc0b66f99a5cdb64.tar.gz
prosody-ea21601ba0ce6c721a8d2197bc0b66f99a5cdb64.zip
mod_privacy: Reduced a function.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_privacy.lua9
1 files changed, 1 insertions, 8 deletions
diff --git a/plugins/mod_privacy.lua b/plugins/mod_privacy.lua
index f23f74f9..5a5c2964 100644
--- a/plugins/mod_privacy.lua
+++ b/plugins/mod_privacy.lua
@@ -184,13 +184,6 @@ function deleteList (privacy_lists, origin, stanza, name)
return {"modify", "bad-request", "Not existing list specifed to be deleted."};
end
-local function sortByOrder(a, b)
- if a.order < b.order then
- return true;
- end
- return false;
-end
-
function createOrReplaceList (privacy_lists, origin, stanza, name, entries, roster)
local idx = findNamedList(privacy_lists, name);
local bare_jid = origin.username.."@"..origin.host;
@@ -277,7 +270,7 @@ function createOrReplaceList (privacy_lists, origin, stanza, name, entries, rost
list.items[#list.items + 1] = tmp;
end
- table.sort(list, sortByOrder);
+ table.sort(list, function(a, b) return a.order < b.order; end);
privacy_lists.lists[idx] = list;
origin.send(st.reply(stanza));