Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (22 sloc) 738 Bytes
require 'rubygems'
require 'xmpp4r'
# = Jabber notifications for Pushr (http://github.com/karmi/pushr/)
# Buy http://peepcode.com/products/xmpp from Topfunky!
class Pushr::Notifier::Jabber < Pushr::Notifier::Base
def deliver!(notification)
return unless configured?
jid = Jabber::JID.new(config['username'])
client = Jabber::Client.new(jid)
client.connect
client.auth(config['password'])
client.send(Jabber::Presence.new.set_status("Pushr at #{Time.now.utc}"))
msg = Jabber::Message.new(config['username'], message(notification))
msg.type = :normal
client.send(msg)
client.close
end
private
def configured?
!config['username'].nil? && !config['password'].nil?
end
end
Something went wrong with that request. Please try again.