Open michealcell opened 5 years ago
I've investigated this a bit, and it only happens to me when logging in with ElvUI Chat History turned on AND having gotten at least one whisper message since the history was turned on.
This patch to WIM fixes the error:
--- a/WIM/WIM.lua
+++ b/WIM/WIM.lua
@@ -539,7 +539,8 @@ function WIM_Incoming(event)
end
-- This chunk of code utilized ChatFrame_MessageEventFilter API's in order to suppress whispers to the chat frame.
-function WIM_ChatFrame_MessageEventFilter_WHISPERS(msg)
+function WIM_ChatFrame_MessageEventFilter_WHISPERS(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, event)
+ local msg = arg1
local filterResult = 0; -- initially, all messages may pass.
if(arg6 ~= "GM") then
filterResult = WIM_FilterResult_Interface(arg1, arg2, event == "CHAT_MSG_WHISPER", false, arg11);
I REALLY do not understand why it worked before (without ElvUI). I suspect there's something funky about varargs in wow lua.
The WIM filter function is called from ElvUI code here.
When that function is in turn called from here via varargs (...
), arg1
, arg2
are accessible in the WIM filter function (even before my patch). I have no idea why!
But when called from the history code, here, arg1
, arg2
etc. are NOT accessible in the WIM filter function, as I would expect. Then it only works with my patch, where these arguments are properly named.
Enough legacy wow rabbit hole for now 😩
Using ElvUI 1.48 and WIM 2.4.15
Message: Interface\AddOns\WIM\WIM.lua:2029: bad argument #1 to 'strlower' (string expected, got nil) Time: 07/05/19 11:48:37 Count: 1 Stack: (tail call): ? C: in function
strlower' Interface\AddOns\WIM\WIM.lua:2029: in function
WIM_FilterResult' Interface\AddOns\WIM\WIM.lua:1994: in functionWIM_FilterResult_Interface' Interface\AddOns\WIM\WIM.lua:545: in function
filterFunc' Interface\AddOns\ElvUI\modules\chat\chat.lua:795: in functionChatFrame_MessageEventHandler' Interface\AddOns\ElvUI\modules\chat\chat.lua:1411: in function
DisplayChatHistory' Interface\AddOns\ElvUI\modules\chat\chat.lua:1673: in function `Initialize' Interface\AddOns\ElvUI\modules\chat\chat.lua:1774: in function <Interface\AddOns\ElvUI\modules\chat\chat.lua:1773> ...ibraries\CallbackHandler-1.0\CallbackHandler-1.0.lua:155: in function <...ibraries\CallbackHandler-1.0\CallbackHandler-1.0.lua:155>[string "safecall Dispatcher[1]"]:13: in function
?' ...ibraries\CallbackHandler-1.0\CallbackHandler-1.0.lua:90: in function
Fire' Interface\AddOns\ElvUI\core\core.lua:1081: in functionInitializeModules' Interface\AddOns\ElvUI\core\core.lua:1241: in function
Initialize' Interface\AddOns\ElvUI\init.lua:145: in function <Interface\AddOns\ElvUI\init.lua:144>