mod_cloud_notify/mod_cloud_notify.lua
changeset 2259 cdfc917a8cc7
parent 2258 122cb5f4930f
child 2261 f84b51f9aa82
equal deleted inserted replaced
2258:122cb5f4930f 2259:cdfc917a8cc7
    34 	local push_node = enable.attr.node;
    34 	local push_node = enable.attr.node;
    35 	if not push_jid then
    35 	if not push_jid then
    36 		origin.send(st.error_reply(stanza, "modify", "bad-request", "Missing jid"));
    36 		origin.send(st.error_reply(stanza, "modify", "bad-request", "Missing jid"));
    37 		return true;
    37 		return true;
    38 	end
    38 	end
    39 	local publish_options = enable.tags[1];
    39 	local publish_options = enable:get_child("x", "jabber:x:data");
    40 	if publish_options and ( publish_options.name ~= "x" or publish_options.attr.xmlns ~= "jabber:x:data" ) then
       
    41 		origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid publish options"));
       
    42 		return true;
       
    43 	end
       
    44 	local user_push_services = push_enabled:get(origin.username);
    40 	local user_push_services = push_enabled:get(origin.username);
    45 	if not user_push_services then
    41 	if not user_push_services then
    46 		user_push_services = {};
    42 		user_push_services = {};
    47 	end
    43 	end
    48 	user_push_services[push_jid .. "<" .. (push_node or "")] = {
    44 	user_push_services[push_jid .. "<" .. (push_node or "")] = {