examples/vcard.lua
author Myhailo Danylenko <isbear@ukrpost.net>
Tue, 31 Mar 2009 18:35:34 +0300
changeset 68 742878c74b8e
parent 67 d33ca5572e91
child 70 e43e386c8a33
permissions -rw-r--r--
Lm separation, privacy * Library parts moved to lm.* * mc_* renamed to plain names * Privacy lists suppart (not tested)


local lm    = require 'lm'
local vcard = require 'lm.vcard'

main.command ( 'vcard-temp',
	function ( args )
		vcard.retrieve ( lm.connection.bless ( main.connection () ), args[1],
			function ( form, submit, reject )
				insert_form ( form,
					function ( form )
						submit ( form,
							function ()
								print ( 'Vcard changed' )
							end,
							function ( mesg )
								print ( 'Vcard changing error: ' .. mesg )
							end )
					end,
					function ( form )
						reject ( form,
							function ()
								print ( 'Vcard changing cancelled' )
							end,
							function ( mesg )
								print ( 'Vcard changing cancellation error: ' .. mesg )
							end )
					end )
			end,
			function ( mesg )
				print ( 'Vcard obtaining error: ' .. mesg )
			end )
	end, true, 'jid' )

-- vim: se ts=4: --