Comparison

plugins/mod_privacy.lua @ 3313:9bcf8d612a52

mod_privacy: Return the correct item-not-found instead of bad-request when a non-existent list is activated by the client (thanks teo)
author Matthew Wild <mwild1@gmail.com>
date Fri, 02 Jul 2010 19:55:08 +0100
parent 3300:b651f8290e27
child 3314:4019ad5c61e2
child 3317:82b17b199d68
comparison
equal deleted inserted replaced
3311:88cfe1bba690 3313:9bcf8d612a52
91 privacy_lists.default = name; 91 privacy_lists.default = name;
92 origin.send(st.reply(stanza)); 92 origin.send(st.reply(stanza));
93 elseif which == "active" and list then 93 elseif which == "active" and list then
94 origin.activePrivacyList = name; 94 origin.activePrivacyList = name;
95 origin.send(st.reply(stanza)); 95 origin.send(st.reply(stanza));
96 elseif not list then
97 return {"cancel", "item-not-found", "No such list: "..name};
96 else 98 else
97 return {"modify", "bad-request", "Either not active or default given or unknown list name specified."}; 99 return {"modify", "bad-request", "No list chosen to be active or default."};
98 end 100 end
99 return true; 101 return true;
100 end 102 end
101 103
102 function deleteList(privacy_lists, origin, stanza, name) 104 function deleteList(privacy_lists, origin, stanza, name)