# HG changeset patch # User Myhailo Danylenko # Date 1237774622 -7200 # Node ID b9fd051c0d7c6d5d09565329a066093cae4f58e5 # Parent 4660c4f10ef18e3c149694ec2fa089b0e68febb4 Ping fixes diff -r 4660c4f10ef1 -r b9fd051c0d7c TODO --- a/TODO Mon Mar 23 04:16:22 2009 +0200 +++ b/TODO Mon Mar 23 04:17:02 2009 +0200 @@ -20,4 +20,5 @@ tune should set self-song only on reply from server test node config publish library handlers? +fix add_feature to 1) not add existing items 2) not add default items diff -r 4660c4f10ef1 -r b9fd051c0d7c examples/ping.lua --- a/examples/ping.lua Mon Mar 23 04:16:22 2009 +0200 +++ b/examples/ping.lua Mon Mar 23 04:17:02 2009 +0200 @@ -11,7 +11,10 @@ ping = { } function ping.send ( conn, to, success, fail ) - iq.send ( conn, to, 'get', success, fail ) + iq.send ( conn, to, 'get', + { + ping = { xmlns = 'urn:xmpp:ping' }, + }, success, fail ) end -- private @@ -42,13 +45,14 @@ local time = os.time () ping.send ( lm.connection.bless ( main.connection () ), who, function () - main.print_info ( ('Pong: %d seconds'):format ( os.time () - time ) ) + main.print_info ( who, ('Pong: %d seconds'):format ( os.time () - time ) ) end, function ( mesg ) - main.print_info ( 'Ping failed: ' .. mesg ) + main.print_info ( who, 'Ping failed: ' .. mesg ) end ) end, true, 'jid' ) +--[[ local ping_handler_registered = false hooks_d['hook-post-connect'].ping = @@ -65,5 +69,6 @@ end main.add_feature ( 'urn:xmpp:ping' ) +--]] -- vim: se ts=4: -- diff -r 4660c4f10ef1 -r b9fd051c0d7c examples/x_data.lua --- a/examples/x_data.lua Mon Mar 23 04:16:22 2009 +0200 +++ b/examples/x_data.lua Mon Mar 23 04:17:02 2009 +0200 @@ -206,6 +206,6 @@ end end, true, form_cid ) -commands_help['form'] = "[del form_id | send form_id | form_id [field_name {clear | [set] value}]\n\nWith bare form id prints info on that form.\nWith field name sets or clears field value. Set subcommand is optional, just to allow values, starting with 'clear'.\nWithout arguments prints form list." +commands_help['form'] = "[form_id [send | reject | [set] fieldname [value]]]\n\nWithout arguments prints form list.\nWith bare form id prints info on that form.\nWhen setting multivalue field, new values are added, not replacing previous.\nWithout value unsets field, multivalue fields lose all their values." -- vim: se ts=4: --