newmail fix

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2016-11-21 13:40:38 +03:00
parent 685d0a04d2
commit 0088e0ecd1

View File

@ -4,9 +4,9 @@ class NewMail < Worker
def mainloop() def mainloop()
while true do while true do
if unread_mail? if unread_mail?
self.write "%{F#{@my_config['ok_colour']}}#{@my_config['ok_message']}%{F-}"
else
self.write "%{F#{@my_config['crit_colour']}}#{@my_config['crit_message']}%{F-}" self.write "%{F#{@my_config['crit_colour']}}#{@my_config['crit_message']}%{F-}"
else
self.write "%{F#{@my_config['ok_colour']}}#{@my_config['ok_message']}%{F-}"
end end
sleep(3) sleep(3)
@ -15,7 +15,7 @@ class NewMail < Worker
def unread_mail? def unread_mail?
@my_config['maildirs'].each do |dir| @my_config['maildirs'].each do |dir|
if (Dir.entries(dir + "/new") - [ '.', '..' ]).empty? if not (Dir.entries(dir + "/new") - [ '.', '..' ]).empty?
return true return true
end end
end end