diff options
Diffstat (limited to 'lib/mauve/notifiers/xmpp.rb')
-rw-r--r-- | lib/mauve/notifiers/xmpp.rb | 12 |
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. |