Method: Eye::Notify::Jabber#execute

Defined in:
lib/eye/notify/jabber.rb

#executeObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/eye/notify/jabber.rb', line 15

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