summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Sluift/Examples/MAMSupportedFields.lua')
-rw-r--r--Sluift/Examples/MAMSupportedFields.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/Sluift/Examples/MAMSupportedFields.lua b/Sluift/Examples/MAMSupportedFields.lua
new file mode 100644
index 0000000..0417924
--- /dev/null
+++ b/Sluift/Examples/MAMSupportedFields.lua
@@ -0,0 +1,18 @@
+-- Retrieving form fields
+-- Usage: ./sluift MAMSupportedFields.lua <jid> <password>
+
+sluift.debug = true
+
+c = sluift.new_client(arg[1], arg[2])
+
+c:connect();
+
+mam_result = c:get_mam{}
+
+for i=1,#mam_result.form.fields do
+ if mam_result.form.fields[i].type ~= "hidden" then
+ print("Server supports: " .. mam_result.form.fields[i].name)
+ end
+end
+
+c:disconnect()