Comparison

mod_muc_inject_mentions/mod_muc_inject_mentions.lua @ 4312:33a41503b9e3

Improve UX by providing defaults users expect
author Seve Ferrer <seve@delape.net>
date Tue, 22 Dec 2020 11:27:20 +0100
parent 4311:a6c253bc63a5
comparison
equal deleted inserted replaced
4311:a6c253bc63a5 4312:33a41503b9e3
113 113
114 return has_mentions, client_mentions 114 return has_mentions, client_mentions
115 end 115 end
116 116
117 local function is_room_eligible(jid) 117 local function is_room_eligible(jid)
118 if not enabled_rooms and not disabled_rooms then 118 if not enabled_rooms and not disabled_rooms then return true; end
119 return true; 119
120 end 120 if enabled_rooms then
121
122 if enabled_rooms and not disabled_rooms then
123 for _, _jid in ipairs(enabled_rooms) do 121 for _, _jid in ipairs(enabled_rooms) do
124 if _jid == jid then 122 if _jid == jid then
125 return true 123 return true
126 end 124 end
127 end 125 end
128 return false 126 return false
129 end 127 end
130 128
131 if disabled_rooms and not enabled_rooms then 129 if disabled_rooms then
132 for _, _jid in ipairs(disabled_rooms) do 130 for _, _jid in ipairs(disabled_rooms) do
133 if _jid == jid then 131 if _jid == jid then
134 return false 132 return false
135 end 133 end
136 end 134 end
137 return true 135 return true
138 end 136 end
139
140 return true
141 end 137 end
142 138
143 local function has_nick_prefix(body, first) 139 local function has_nick_prefix(body, first)
144 -- There are no configured prefixes 140 -- There are no configured prefixes
145 if not prefixes or #prefixes < 1 then return false end 141 if not prefixes or #prefixes < 1 then return false end