Software /
code /
verse
Comparison
plugins/smacks.lua @ 200:4166213cc9bd
plugins.smacks: Add 1s delay between reconnect attempts
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 18 Mar 2011 21:42:00 +0000 |
parent | 197:7e98cf2c1d8d |
child | 201:1fce24cb2c41 |
comparison
equal
deleted
inserted
replaced
199:33b54389ed9c | 200:4166213cc9bd |
---|---|
18 | 18 |
19 local function on_disconnect() | 19 local function on_disconnect() |
20 stream.stream_management_supported = nil; | 20 stream.stream_management_supported = nil; |
21 if stream.resumption_token then | 21 if stream.resumption_token then |
22 stream.authenticated = nil; | 22 stream.authenticated = nil; |
23 stream:connect(stream.connect_host or stream.host, stream.connect_port or 5222); | 23 verse.add_task(1, function () |
24 stream:reopen(); | 24 stream:connect(stream.connect_host or stream.host, stream.connect_port or 5222); |
25 end); | |
25 return true; | 26 return true; |
26 end | 27 end |
27 end | 28 end |
28 | 29 |
29 local function handle_sm_command(stanza) | 30 local function handle_sm_command(stanza) |