Diff

util/events.lua @ 1162:bd1f0e6d50a7

Merging SASL buggy client workaround with current tip.
author Tobias Markmann <tm@ayena.de>
date Fri, 15 May 2009 17:33:04 +0200
parent 1146:542d49518d3a
child 1175:edef0c10e076
line wrap: on
line diff
--- a/util/events.lua	Fri May 15 17:28:39 2009 +0200
+++ b/util/events.lua	Fri May 15 17:33:04 2009 +0200
@@ -53,7 +53,8 @@
 		if not h then h = {}; handlers[event] = h; end
 		local dispatcher = function(data)
 			for _, handler in ipairs(h) do
-				handler(data);
+				local ret = handler(data);
+				if ret ~= nil then return ret; end
 			end
 		end;
 		dispatchers[event] = dispatcher;
@@ -66,7 +67,8 @@
 		local h = handlers[event];
 		if h then
 			for _, handler in ipairs(h) do
-				handler(data);
+				local ret = handler(data);
+				if ret ~= nil then return ret; end
 			end
 		end
 	end;