Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(polls) add extra check when creating polls

Saúl Ibarra Corretgé39540531ffa0
diff --git a/resources/prosody-plugins/mod_polls.lua b/resources/prosody-plugins/mod_polls.lua
index 6ec30864e8..dec9f79462 100644
--- a/resources/prosody-plugins/mod_polls.lua
+++ b/resources/prosody-plugins/mod_polls.lua
@@ -113,6 +113,11 @@ module:hook("message/bare", function(event)
return
end
+ if room.polls.by_id[data.pollId] ~= nil then
+ module:log("error", "Poll already exists: %s", data.pollId);
+ return;
+ end
+
local answers = {}
local compact_answers = {}
for i, name in ipairs(data.answers) do