Quantcast

-Fixed a stupid taint issue with removing glyphs. Why does blizzard keep adding taint calls to functions, in every expansion.

Xruptor [10-14-12 - 14:19]
-Fixed a stupid taint issue with removing glyphs.  Why does blizzard keep adding taint calls to functions, in every expansion.
Filename
XanChat.lua
XanChat.toc
diff --git a/XanChat.lua b/XanChat.lua
index 7adfddf..8c32dac 100644
--- a/XanChat.lua
+++ b/XanChat.lua
@@ -146,24 +146,13 @@ StaticPopupDialogs["LINKME"] = {
 	maxLetters = 255,
 }

-function xanChat_URLRef(link, text, button)
-	if (strsub(link, 1, 3) == "url") then
+local SetHyperlink = _G.ItemRefTooltip.SetHyperlink
+function _G.ItemRefTooltip:SetHyperlink(link, ...)
+	if link and (strsub(link, 1, 3) == "url") then
 		local url = strsub(link, 5)
-
-		-- local activeWindow = ChatEdit_GetActiveWindow()
-
-		-- if ( activeWindow ) then
-			-- activeWindow:Insert(url)
-			-- ChatEdit_FocusActiveWindow()
-		-- else
-			-- ChatEdit_GetLastActiveWindow():Show()
-			-- ChatEdit_GetLastActiveWindow():Insert(url)
-			-- ChatEdit_GetLastActiveWindow():SetFocus()
-		-- end
-
 		local dialog = StaticPopup_Show("LINKME")
-
 		local editbox = _G[dialog:GetName().."EditBox"]
+
 		editbox:SetText(url)
 		editbox:SetFocus()
 		editbox:HighlightText()
@@ -172,13 +161,12 @@ function xanChat_URLRef(link, text, button)
 		button:ClearAllPoints()
 		button:SetPoint("CENTER", editbox, "CENTER", 0, -30)

-	else
-		SetItemRef_orig(link, text, button)
-	end
+		return
+     end
+
+	 SetHyperlink(self, link, ...)
 end

-SetItemRef = xanChat_URLRef
-
 ChatFrame_AddMessageEventFilter("CHAT_MSG_BATTLEGROUND_LEADER", urlFilter)
 ChatFrame_AddMessageEventFilter("CHAT_MSG_BN_CONVERSATION", urlFilter)
 ChatFrame_AddMessageEventFilter("CHAT_MSG_BN_WHISPER", urlFilter)
diff --git a/XanChat.toc b/XanChat.toc
index 658266e..0eafc23 100644
--- a/XanChat.toc
+++ b/XanChat.toc
@@ -2,7 +2,7 @@
 ## Title: xanChat
 ## Notes: A very minimalistic chat modification addon.
 ## Author: Xruptor
-## Version: 3.5
+## Version: 3.6
 ## SavedVariables: XCHT_DB

 xanChat.lua