fix(polls): Drops not needed check.

This commit is contained in:
damencho
2025-12-29 11:39:28 -06:00
committed by Дамян Минков
parent 66f7b9de53
commit 47aa51a58c

View File

@@ -33,15 +33,6 @@ local main_domain = module:get_option_string('main_domain');
-- only the visitor prosody has main_domain setting
local is_visitor_prosody = main_domain ~= nil;
-- Logs a warning and returns true if a room does not
-- have poll data associated with it.
local function check_polls(room)
if room.polls == nil then
module:log("warn", "no polls data in room");
return true;
end
return false;
end
local function validate_polls(data)
if type(data) ~= 'table' then
@@ -222,8 +213,6 @@ end
return true;
end
if check_polls(room) then return end
local poll_creator = occupant_details;
if room.polls.count >= POLLS_LIMIT then
@@ -286,8 +275,6 @@ end
module:context(jid.host(room.jid)):fire_event('poll-created', pollData);
elseif data.command == "answer-poll" then
if check_polls(room) then return end
local poll = room.polls.by_id[data.pollId];
if poll == nil then
module:log("warn", "answering inexistent poll %s", data.pollId);