--- a/mod_service_directories/mod_service_directories.lua Sun Jan 27 17:34:16 2013 +0100
+++ b/mod_service_directories/mod_service_directories.lua Mon Feb 04 01:36:41 2013 +0100
@@ -14,6 +14,7 @@
local adhoc_new = module:require "adhoc".new;
local to_ascii = require "util.encodings".idna.to_ascii;
local nameprep = require "util.encodings".stringprep.nameprep;
+local dataforms_new = require "util.dataforms".new;
local pairs, ipairs = pairs, ipairs;
local module = module;
local hosts = hosts;
@@ -79,7 +80,7 @@
-- Admin ad-hoc command to subscribe
local function add_contact_handler(self, data, state)
- local layout = {
+ local layout = dataforms_new{
title = "Adding a Server Buddy";
instructions = "Fill out this form to add a \"server buddy\".";
@@ -92,7 +93,7 @@
elseif data.action == "canceled" then
return { status = "canceled" };
else
- local fields = layout:data(data);
+ local fields = layout:data(data.form);
local peerjid = nameprep(fields.peerjid);
if not peerjid or peerjid == "" or #peerjid > 1023 or not to_ascii(peerjid) then
return { status = "completed", error = { message = "Invalid JID" } };