Changeset

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
parents 199:33b54389ed9c
children 201:1fce24cb2c41
files plugins/smacks.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/smacks.lua	Fri Mar 18 21:39:57 2011 +0000
+++ b/plugins/smacks.lua	Fri Mar 18 21:42:00 2011 +0000
@@ -20,8 +20,9 @@
 		stream.stream_management_supported = nil;
 		if stream.resumption_token then
 			stream.authenticated = nil;
-			stream:connect(stream.connect_host or stream.host, stream.connect_port or 5222);
-			stream:reopen();
+			verse.add_task(1, function ()
+				stream:connect(stream.connect_host or stream.host, stream.connect_port or 5222);
+			end);
 			return true;
 		end
 	end