Comparison

mod_webpresence/mod_webpresence.lua @ 5594:14480ca9576e

mod_webpresence: Add TODO about fixing the first adhoc form.
author Trần H. Trung <xmpp:trần.h.trung@trung.fun>
date Mon, 10 Jul 2023 19:19:36 +0700
parent 5588:f16720087ef2
child 5633:758866b43aa4
comparison
equal deleted inserted replaced
5593:04f36a470dca 5594:14480ca9576e
37 instructions = "Your webpresence shows offline by default"; 37 instructions = "Your webpresence shows offline by default";
38 { 38 {
39 type = "boolean"; 39 type = "boolean";
40 name = moduleName; 40 name = moduleName;
41 label = "Show"; 41 label = "Show";
42 value = webpresence_get(); 42 --value = webpresence_get();
43 }; 43 };
44 }; 44 };
45 local formResult = utilDataforms.new { 45 local formResult = utilDataforms.new {
46 title = "Web Presence Policy"; 46 title = "Web Presence Policy";
47 { 47 {
48 type = "boolean"; 48 type = "boolean";
49 name = moduleName; 49 name = moduleName;
50 label = "Show"; 50 label = "Show";
51 value; 51 --value;
52 }; 52 };
53 { 53 {
54 type = "text-multi"; 54 type = "text-multi";
55 name = "url"; 55 name = "url";
56 label = "Check your presence at"; 56 label = "Check your presence at";
75 urlResult = urlResult..urlBase..v.."\n"; 75 urlResult = urlResult..urlBase..v.."\n";
76 end 76 end
77 return urlResult; 77 return urlResult;
78 end 78 end
79 79
80 -- TODO:
81 -- Fix the handler (somehow) to make `form` shows the correct value.
82 --
80 local adhoc_handler = utilAdhoc.new_simple_form(form, function(fields, state, data) 83 local adhoc_handler = utilAdhoc.new_simple_form(form, function(fields, state, data)
81 local jid_bare = jid.bare(data.from); 84 local jid_bare = jid.bare(data.from);
82 local user, host = jid_split(jid_bare); 85 local user, host = jid_split(jid_bare);
83 86
84 local oldData, _ = storage:get(user); 87 local oldData, _ = storage:get(user);