fix(polls): Returns an error on duplicate poll.

This commit is contained in:
damencho
2024-12-17 15:15:58 -06:00
committed by Дамян Минков
parent 938d112f6b
commit 6bb984acc8

View File

@@ -115,7 +115,8 @@ module:hook("message/bare", function(event)
if room.polls.by_id[data.pollId] ~= nil then
module:log("error", "Poll already exists: %s", data.pollId);
return;
event.origin.send(st.error_reply(event.stanza, 'cancel', 'not-allowed', 'Poll already exists'));
return true;
end
local answers = {}