--- a/examples/xep0060.lua Sun Mar 15 20:45:24 2009 +0200
+++ b/examples/xep0060.lua Sun Mar 15 21:13:10 2009 +0200
@@ -84,7 +84,23 @@
},
},
},
- })
+ },
+ function ( conn, mess )
+ local mt, st = mess:type ()
+ if st == 'result' then
+ main.print_info ( to, 'Now you can run /form del ' .. fid .. ' to delete form from list' )
+ form.status = 'acquired'
+ elseif st == 'error' then
+ main.print_info ( to, 'Got non-successful response to form:\n' .. mess:xml () )
+ form.status = 'rejected'
+ else
+ print ( 'Weird response to submitted form:\n' .. mess:xml () )
+ form.status = 'unknown'
+ return false
+ end
+ return true
+ end )
+ form.status = 'sent'
end
forms[fid].status = 'filling'
main.print_info ( to, 'You have new form. To fill it, use /form ' .. fid .. ' fieldname value' )