Sha256: 73b11dbdd870a8d5598d423f17b85ab6358641477383366aa839cf66bc557f82

Contents?: true

Size: 767 Bytes

Versions: 16

Compression:

Stored size: 767 Bytes

Contents

require 'xmpp4r'

class Eye::Notify::Jabber < Eye::Notify

  # Eye.config do
  #   jabber :host => "some.host", :port => 12345, :user => "eye@some.host", :password => "123456"
  #   contact :vasya, :jabber, "vasya@some.host"
  # end

  param :host, String, true
  param :port, [String, Fixnum], true
  param :user, String, true
  param :password, String

  def execute
    debug "send jabber #{[host, port, user, password]} - #{[contact, message_body]}"

    mes = ::Jabber::Message.new(contact, message_body)
    mes.set_type(:normal)
    mes.set_id('1')
    mes.set_subject(message_subject)

    client = ::Jabber::Client.new(::Jabber::JID.new("#{user}/Eye"))
    client.connect(host, port)
    client.auth(password)
    client.send(mes)
    client.close
  end

end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
eye-0.6.2 lib/eye/notify/jabber.rb
eye-0.6.2.pre lib/eye/notify/jabber.rb
ace-eye-0.6.5 lib/eye/notify/jabber.rb
ace-eye-0.6.4 lib/eye/notify/jabber.rb
eye-0.6.1 lib/eye/notify/jabber.rb
ace-eye-0.6.3 lib/eye/notify/jabber.rb
ace-eye-0.6.2 lib/eye/notify/jabber.rb
ace-eye-0.6.1 lib/eye/notify/jabber.rb
eye-0.6 lib/eye/notify/jabber.rb
reel-eye-0.5.2.1 lib/eye/notify/jabber.rb
reel-eye-0.5.2 lib/eye/notify/jabber.rb
eye-0.5.2 lib/eye/notify/jabber.rb
reel-eye-0.5.1 lib/eye/notify/jabber.rb
eye-0.5.1 lib/eye/notify/jabber.rb
reel-eye-0.5 lib/eye/notify/jabber.rb
eye-0.5 lib/eye/notify/jabber.rb