Poll WIP (#231):

* poll backend WIP
This commit is contained in:
John Livingston
2024-06-29 19:33:37 +02:00
parent 300eb14ca4
commit e779a669c8
2 changed files with 90 additions and 2 deletions

View File

@ -18,6 +18,7 @@ local get_room_from_jid = mod_muc.get_room_from_jid;
local xmlns_poll = module:require("constants").xmlns_poll;
local send_form = module:require("form").send_form;
local process_form = module:require("form").process_form;
local handle_groupchat = module:require("poll").handle_groupchat;
-- new poll creation, get form
module:hook("iq-get/bare/" .. xmlns_poll .. ":query", function (event)
@ -66,3 +67,6 @@ end);
module:hook("muc-disco#info", function (event)
event.reply:tag("feature", { var = xmlns_poll }):up();
end);
-- on groupchat messages, we check if this is a vote for the current poll
module:hook("muc-occupant-groupchat", handle_groupchat);