equal
deleted
inserted
replaced
20 local sent = 0; |
20 local sent = 0; |
21 local room = event.room; |
21 local room = event.room; |
22 for jid, affiliation, data in room:each_affiliation() do --luacheck: ignore 213/affiliation |
22 for jid, affiliation, data in room:each_affiliation() do --luacheck: ignore 213/affiliation |
23 local reserved_nickname = data and data.reserved_nickname; |
23 local reserved_nickname = data and data.reserved_nickname; |
24 local user_setting = data and data.offline_delivery or nil; |
24 local user_setting = data and data.offline_delivery or nil; |
25 if reserved_nickname and user_setting or (user_setting == nil and default_enable) then |
25 if reserved_nickname and (user_setting or (user_setting == nil and default_enable)) then |
26 local is_absent = not room:get_occupant_by_nick(room.jid.."/"..reserved_nickname); |
26 local is_absent = not room:get_occupant_by_nick(room.jid.."/"..reserved_nickname); |
27 if is_absent then |
27 if is_absent then |
28 module:log("debug", "Forwarding message to offline member <%s>", jid); |
28 module:log("debug", "Forwarding message to offline member <%s>", jid); |
29 local msg = st.clone(event.stanza); |
29 local msg = st.clone(event.stanza); |
30 msg.attr.to = jid; |
30 msg.attr.to = jid; |