Software /
code /
prosody
File
util/adhoc.lua @ 6429:675aea867574
plugins/muc: Add muc-occupant-groupchat event
- Plugins can cancel messages before they are broadcast; and while they still have real from jid
- Use it for subject changes
- Allows for custom roles (via role_rank)
- Roles are now checked before subject
- Removed muc-subject-change event
author | daurnimator <quae@daurnimator.com> |
---|---|
date | Thu, 25 Sep 2014 17:43:00 -0400 |
parent | 5513:755f705f126a |
child | 7912:2c204ba8e52e |
line wrap: on
line source
local function new_simple_form(form, result_handler) return function(self, data, state) if state then if data.action == "cancel" then return { status = "canceled" }; end local fields, err = form:data(data.form); return result_handler(fields, err, data); else return { status = "executing", actions = {"next", "complete", default = "complete"}, form = form }, "executing"; end end end local function new_initial_data_form(form, initial_data, result_handler) return function(self, data, state) if state then if data.action == "cancel" then return { status = "canceled" }; end local fields, err = form:data(data.form); return result_handler(fields, err, data); else return { status = "executing", actions = {"next", "complete", default = "complete"}, form = { layout = form, values = initial_data() } }, "executing"; end end end return { new_simple_form = new_simple_form, new_initial_data_form = new_initial_data_form };