--- a/test.lua Tue May 19 00:44:52 2009 +0300
+++ b/test.lua Tue May 19 01:16:55 2009 +0300
@@ -9,10 +9,10 @@
sent = false
-server = 'jabber.kiev.ua'
-username = arg[1]
-password = arg[2]
-fingerprint = 'D5:F9:7B:6F:90:CC:E9:3C:36:AE:5E:3A:47:E4:C5:65'
+server, username = arg[1]:match ( '(.+)@(.-)' )
+password = arg[2]
+recipient = arg[3] or arg[1]
+fingerprint = arg[4] or '01:23:45:67:89:ab:cd:ef:fe:dc:ba:98:76:54:32:10'
--[[
-- What's goes on, pretty close to C api,
@@ -48,11 +48,11 @@
print ( "Sending..." )
connection:send (
- lm.message.new( 'isbear@jabber.kiev.ua', 'message' )
+ lm.message.new( recipient, 'message' )
:child ( 'body', 'Hello, this is just a test' ) )
connection:send (
- lm.message.new( 'isbear@jabber.kiev.ua/lair', 'iq', 'get' )
+ lm.message.new( recipient, 'iq', 'get' )
:child( 'query', '' ):attribute ( 'xmlns', 'jabber:iq:version' ),
function ( connection, message )
node = message:child ( 'query' )
@@ -94,13 +94,13 @@
print ( 'connected' )
connection:send (
- lm.message.create { mtype = "message", to = 'isbear@jabber.kiev.ua',
+ lm.message.create { mtype = "message", to = recipient,
body = { 'Hello, this is just a test' },
} )
print ( 'sent' )
connection:send (
- lm.message.create { mtype = "iq-get", to = "isbear@jabber.kiev.ua/lair",
+ lm.message.create { mtype = "iq-get", to = recipient,
query = { xmlns = "jabber:iq:version" }
},
function ( connection, message )