Implements method to retrieve endpoints with associated recipients

Implements #4389
This commit is contained in:
Simone Mainardi 2020-09-11 09:58:11 +02:00
parent 98fca69c06
commit 06bf75c048
4 changed files with 43 additions and 4 deletions

View file

@ -396,6 +396,24 @@ function recipients:delete_recipients_by_conf(endpoint_conf_name)
end
end
-- ##############################################
-- @brief Get all recipients having the given `endpoint_conf_name`
-- @param endpoint_conf_name An endpoint configuration key
-- @return A lua array with recipients
function recipients:get_recipients_by_conf(endpoint_conf_name)
local res = {}
local all_recipients = self:get_all_recipients()
for _, recipient in pairs(all_recipients) do
if recipient.endpoint_conf_name == endpoint_conf_name then
res[#res + 1] = recipient
end
end
return res
end
-- #################################################################
function recipients:test_recipient(endpoint_conf_name, recipient_params)