Skip to content

Instantly share code, notes, and snippets.

@jsierles
Created August 4, 2008 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsierles/3908 to your computer and use it in GitHub Desktop.
Save jsierles/3908 to your computer and use it in GitHub Desktop.
main_loop = GLib::MainLoop.new
conn = LM::Connection.new(host)
conn.jid = jid
conn.open do |result|
puts "Connection open block"
if result
puts "Connection opened correctly"
conn.authenticate(login, password, "Test") do |auth_result|
unless auth_result
puts "Failed to authenticate"
end
end
else
puts "Failed to connect"
main_loop.quit
end
end
m = LM::Message.new('test@localhost', LM::MessageType::MESSAGE)
m.node.add_child('body', 'test')
conn.send(m)
main_loop.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment