aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/notifiers/xmpp.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-07-08 17:24:08 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-07-08 17:24:08 +0100
commit1ac431fa21907a2a95d87901825cff3dc462746b (patch)
treebee0d55b3fb936bdd77095cdb32970379f4c82d0 /lib/mauve/notifiers/xmpp.rb
parentfdfd98e5117b269d1f30dfbbd9c1cf2cf037658a (diff)
Added first basic history functionality, and rejigged when notify is called for
an alert.
Diffstat (limited to 'lib/mauve/notifiers/xmpp.rb')
-rw-r--r--lib/mauve/notifiers/xmpp.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/mauve/notifiers/xmpp.rb b/lib/mauve/notifiers/xmpp.rb
index 4c30643..c4e1785 100644
--- a/lib/mauve/notifiers/xmpp.rb
+++ b/lib/mauve/notifiers/xmpp.rb
@@ -203,7 +203,17 @@ module Mauve
alert.to_s
end
- send_message(destination_jid, txt)
+ history = Mauve::History.new(:alert_id => alert.id, :type => :notification)
+
+ if send_message(destination_jid, txt)
+ history.event = "Sent XMPP message to #{destination_jid}"
+ history.save
+ true
+ else
+ history.event = "Failed to send XMPP message to #{destination_jid}"
+ history.save
+ false
+ end
end
# Sends a message to the destionation.