From e07cea09e884607d6ad005f5e2822251ca31b9ba Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Wed, 13 Jul 2011 16:44:17 +0100 Subject: Further tweaks. --- lib/mauve/alert.rb | 2 -- lib/mauve/alert_changed.rb | 5 +++-- lib/mauve/notifiers/xmpp.rb | 8 ++++---- lib/mauve/processor.rb | 2 -- views/_acknowledge_input.haml | 6 +++--- views/alert.haml | 13 ------------- 6 files changed, 10 insertions(+), 26 deletions(-) diff --git a/lib/mauve/alert.rb b/lib/mauve/alert.rb index 164139b..147c7cb 100644 --- a/lib/mauve/alert.rb +++ b/lib/mauve/alert.rb @@ -404,8 +404,6 @@ module Mauve # # Make sure that we raise if neither raise nor clear is set # - logger.warn("No clear time or raise time set. Assuming raised!") - raise_time = reception_time end diff --git a/lib/mauve/alert_changed.rb b/lib/mauve/alert_changed.rb index 740b9dc..4dcba8e 100644 --- a/lib/mauve/alert_changed.rb +++ b/lib/mauve/alert_changed.rb @@ -92,7 +92,6 @@ module Mauve end - logger.info "Reminding someone about #{self.inspect}" alert_group = AlertGroup.matches(alert)[0] @@ -100,11 +99,13 @@ module Mauve logger.info((alert_group ? "Alert already acknowledged" : "No alert group matches any more" - ) + ", no reminder due" + ) + " => no reminder due for #{self.alert.inspect}" ) self.remind_at = nil save else + logger.info "Sending a reminder for #{self.alert.inspect}" + saved = false unless alert_group.notifications.nil? diff --git a/lib/mauve/notifiers/xmpp.rb b/lib/mauve/notifiers/xmpp.rb index 8131096..34cc815 100644 --- a/lib/mauve/notifiers/xmpp.rb +++ b/lib/mauve/notifiers/xmpp.rb @@ -258,12 +258,12 @@ module Mauve # Joins a chat, and returns the stripped JID of the chat joined. # def join_muc(jid, password=nil) - if jid.is_a?(String) - jid = JID.new($1) if jid =~ /^muc:(.*)/ + if jid.is_a?(String) and jid =~ /^muc:(.*)/ + jid = JID.new($1) end unless jid.is_a?(JID) - logger.warn "I don't think #{jid} is a MUC" + logger.warn "#{jid} is not a MUC" return end @@ -271,7 +271,7 @@ module Mauve if !@mucs[jid.strip] - logger.info("Adding new MUC client for #{jid}") + logger.debug("Adding new MUC client for #{jid}") @mucs[jid.strip] = Jabber::MUC::MUCClient.new(@client) diff --git a/lib/mauve/processor.rb b/lib/mauve/processor.rb index f36dacb..a1c0896 100644 --- a/lib/mauve/processor.rb +++ b/lib/mauve/processor.rb @@ -38,8 +38,6 @@ module Mauve Timer.instance.freeze unless Timer.instance.frozen? - raise ArgumentError, "arse" - logger.debug("Got #{data.inspect} from #{client.inspect}") ip_source = "#{client[3]}:#{client[1]}" diff --git a/views/_acknowledge_input.haml b/views/_acknowledge_input.haml index 82f3044..97847c8 100644 --- a/views/_acknowledge_input.haml +++ b/views/_acknowledge_input.haml @@ -8,9 +8,9 @@ Acknowledge these alerts for hours %span#ack_until_text %input#ack_until{ :value => '', :type => :hidden, :name => 'ack_until' } -%br -with the note -%input#note{ :name => 'note', :type => "text"} +-# %br +-# with the note +-# %input#note{ :name => 'note', :type => "text"} %input{ :type => 'submit', :value => 'Go!' } :javascript // Change of value in the hours box diff --git a/views/alert.haml b/views/alert.haml index d4e274f..30aeb86 100644 --- a/views/alert.haml +++ b/views/alert.haml @@ -43,19 +43,6 @@ %tr %th{:title => "The time at which the alert will be automatically cleared"} Will clear %td= @alert.will_raise_at.to_s_human - %tr - %th Notifications sent out - %td - %ul - - @alert.changes.first(10).each do |change| - - if change.was_relevant? - %li - %strong= change.level - = change.update_type - notification to - = change.person - at - = change.at.to_s_human %tr %th History %td -- cgit v1.2.1