Sha256: 3bbfddc04b9b113dc2f736323aa057956a8059d6b34cef77dab45837e953eb21

Contents?: true

Size: 773 Bytes

Versions: 10

Compression:

Stored size: 773 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, Integer], 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

10 entries across 10 versions & 1 rubygems

Version Path
eye-0.10.1.pre lib/eye/notify/jabber.rb
eye-0.10.0 lib/eye/notify/jabber.rb
eye-0.10.0.alpha2 lib/eye/notify/jabber.rb
eye-0.10.0.alpha lib/eye/notify/jabber.rb
eye-0.9.4.nosigar lib/eye/notify/jabber.rb
eye-0.9.4 lib/eye/notify/jabber.rb
eye-0.9.3 lib/eye/notify/jabber.rb
eye-0.9.2.nosigar lib/eye/notify/jabber.rb
eye-0.9.2 lib/eye/notify/jabber.rb
eye-0.9.1 lib/eye/notify/jabber.rb