diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-13 11:02:37 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-13 11:02:37 +0100 |
commit | b22cbc87927553f6dbb5754281e95fe9bad2eed1 (patch) | |
tree | 5575791fe84492648a8cc92433c267815056507a /lib/mauve/person.rb | |
parent | 495c44445642cfae8f23fadde299ad5307f5be58 (diff) |
* Tidied up mauveserver to handle HUP restarts
* Added HTML santizing to the alert class, so bad HTML is stripped as part of
processing.
* Alert#cleared? now means "not raised"
* Better error handling in the Timer class, making sure that the timer never
gets permanently frozen.
* Moved notification and packet buffers to the Server class, meaning that if
the Processor or Notifier threads crash, we don't lose all the items waiting
to be processed/notified.
* XMPP/Email Alerts now use templates, instead of instance methods.
* Emails now get sent as multipart with HTML to allow detail fields to be
shown as nature intended.
Diffstat (limited to 'lib/mauve/person.rb')
-rw-r--r-- | lib/mauve/person.rb | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/mauve/person.rb b/lib/mauve/person.rb index 42b6baf..82845e6 100644 --- a/lib/mauve/person.rb +++ b/lib/mauve/person.rb @@ -139,19 +139,7 @@ module Mauve last_change.was_relevant = true if false == last_change.nil? end - # Send the notification is need be. - if !last_change || last_change.update_type.to_sym == :cleared - # Person has never heard of this alert before, or previously cleared. - # - # We don't send any alert if such a change isn't relevant to this - # Person at this time. - send_alert(level, alert) if is_relevant and [:raised, :changed].include?(alert.update_type.to_sym) - - else - # Relevance is determined by whether the user heard of this alert - # being raised. - send_alert(level, alert) if last_change.was_relevant_when_raised? - end + send_alert(level, alert ) # if last_change.was_relevant_when_raised? end def remind(alert, level) @@ -163,7 +151,7 @@ module Mauve # This just wraps send_alert by sending the job to a queue. # def send_alert(level, alert) - Notifier.push([self, level, alert]) + Server.notification_push([self, level, alert]) end def do_send_alert(level, alert) |