Add "IGNORED" state to actions on list members

This commit is contained in:
Timothée Floure 2018-10-07 22:18:47 +02:00
parent 1c8eb14154
commit 2758ba5982

View file

@ -76,30 +76,34 @@ def main
if (subscribers.include?(m)) if (subscribers.include?(m))
subscribers.delete(m) subscribers.delete(m)
else else
if (conf["lists_add"].include?(cn))
print "Adding #{m}... " print "Adding #{m}... "
if (conf["lists_add"].include?(cn))
mlmmj_sub_binary = conf["mlmmj"]["sub_binary"] mlmmj_sub_binary = conf["mlmmj"]["sub_binary"]
%x(#{mlmmj_sub_binary} -L #{list} -a #{m} -q -f -s) %x(#{mlmmj_sub_binary} -L #{list} -a #{m} -q -f -s)
if ($?.exitstatus == 0) if ($?.exitstatus == 0)
puts "OK" puts "OK"
else else
puts "Failed" puts "FAILED"
end end
else
puts "IGNORED"
end end
end end
end end
# Remove remaining "subcribers" (= they did not match with members) # Remove remaining "subcribers" (= they did not match with members)
if (conf["lists_remove"].include?(cn))
subscribers.each do |s| subscribers.each do |s|
print "Removing #{s}... " print "Removing #{s}... "
if (conf["lists_remove"].include?(cn))
mlmmj_unsub_binary = conf["mlmmj"]["unsub_binary"] mlmmj_unsub_binary = conf["mlmmj"]["unsub_binary"]
%x(#{mlmmj_unsub_binary} -L #{list} -a #{s} -q -s) %x(#{mlmmj_unsub_binary} -L #{list} -a #{s} -q -s)
if ($?.exitstatus == 0) if ($?.exitstatus == 0)
puts "OK" puts "OK"
else else
puts "Failed" puts "FAILED"
end end
else
puts "IGNORED"
end end
end end
print "\n" print "\n"