Software /
code /
prosody
Changeset
2499:145d62abdbfc
mod_privacy: Reduced a function.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 26 Jan 2010 01:49:45 +0500 |
parents | 2498:3d08a6cf57ea |
children | 2500:bffdaeb7ab5e |
files | plugins/mod_privacy.lua |
diffstat | 1 files changed, 1 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_privacy.lua Tue Jan 26 01:47:21 2010 +0500 +++ b/plugins/mod_privacy.lua Tue Jan 26 01:49:45 2010 +0500 @@ -184,13 +184,6 @@ 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 @@ 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));