Quantcast

Teh links

Darthpred [10-04-13 - 07:06]
Teh links
Filename
ElvUI_SLE/modules/chat/chat.lua
diff --git a/ElvUI_SLE/modules/chat/chat.lua b/ElvUI_SLE/modules/chat/chat.lua
index 8cb58e3..60177fb 100755
--- a/ElvUI_SLE/modules/chat/chat.lua
+++ b/ElvUI_SLE/modules/chat/chat.lua
@@ -693,4 +693,37 @@ function CH:PositionChat(override)
 	end

 	self.initialMove = true;
-end
\ No newline at end of file
+end
+
+function CH:ChatFrame_AddMessageEventFilter (event, filter)
+	assert(event and filter);
+
+	if ( chatFilters[event] ) then
+		-- Only allow a filter to be added once
+		for index, filterFunc in next, chatFilters[event] do
+			if ( filterFunc == filter ) then
+				return;
+			end
+		end
+	else
+		chatFilters[event] = {};
+	end
+
+	tinsert(chatFilters[event], filter);
+end
+
+function CH:ChatFrame_RemoveMessageEventFilter (event, filter)
+	assert(event and filter);
+
+	if ( chatFilters[event] ) then
+		for index, filterFunc in next, chatFilters[event] do
+			if ( filterFunc == filter ) then
+				tremove(chatFilters[event], index);
+			end
+		end
+
+		if ( #chatFilters[event] == 0 ) then
+			chatFilters[event] = nil;
+		end
+	end
+end