Created
August 4, 2008 15:18
-
-
Save jsierles/3908 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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