diff mod_component_client/mod_component_client.lua @ 1208:defa479a7d53

mod_component_client: Fire connect (logged in) and disconnect events
author Waqas Hussain <waqas20@gmail.com>
date Fri, 11 Oct 2013 16:56:06 -0400
parents 8b14cdfe0213
children fc39f78e2b36
line wrap: on
line diff
--- a/mod_component_client/mod_component_client.lua	Mon Sep 02 20:10:10 2013 +0200
+++ b/mod_component_client/mod_component_client.lua	Fri Oct 11 16:56:06 2013 -0400
@@ -91,6 +91,7 @@
 module:hook("stanza/jabber:component:accept:handshake", function(event)
 	session.type = "component";
 	module:log("debug", "Handshake complete");
+	module:fire_event("component_client/connected", {});
 	return true; -- READY!
 end);
 
@@ -210,6 +211,7 @@
 	end
 	__conn = nil;
 	module:log("error", "connection lost");
+	module:fire_event("component_client/disconnected", { reason = err });
 end
 
 function connect()