Skip to content

Commit

Permalink
fix(polls): Returns an error on duplicate poll.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Dec 17, 2024
1 parent 938d112 commit 35e2117
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion resources/prosody-plugins/mod_polls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down

0 comments on commit 35e2117

Please sign in to comment.