changeset 4780:4abb33a15897

mod_muc_offline_delivery: Fix logic bug causing traceback when no reserved_nick (thanks Hund)
author Matthew Wild <mwild1@gmail.com>
date Fri, 19 Nov 2021 17:00:38 +0000
parents 6395d4732bc6
children 306066898e5f
files mod_muc_offline_delivery/mod_muc_offline_delivery.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_muc_offline_delivery/mod_muc_offline_delivery.lua	Fri Nov 19 13:45:21 2021 +0100
+++ b/mod_muc_offline_delivery/mod_muc_offline_delivery.lua	Fri Nov 19 17:00:38 2021 +0000
@@ -22,7 +22,7 @@
 	for jid, affiliation, data in room:each_affiliation() do --luacheck: ignore 213/affiliation
 		local reserved_nickname = data and data.reserved_nickname;
 		local user_setting = data and data.offline_delivery or nil;
-		if reserved_nickname and user_setting or (user_setting == nil and default_enable) then
+		if reserved_nickname and (user_setting or (user_setting == nil and default_enable)) then
 			local is_absent = not room:get_occupant_by_nick(room.jid.."/"..reserved_nickname);
 			if is_absent then
 				module:log("debug", "Forwarding message to offline member <%s>", jid);