WIM (WoW Instant Messenger) v3

17M Downloads

Invalid escape code in chat message

R41z0r opened this issue ยท 9 comments

commented

Hey there - Always when I try to send someone an item with quality, I'm getting the following error:
5x SendChatMessage(): Invalid escape code in chat message
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "@WIM/Modules/WhisperEngine.lua"]:746: in function SendChatMessage' [string "@BugSack/Libs/AceComm-3.0-12/ChatThrottleLib.lua"]:434: in function SendChatMessage'
[string "@WIM/Modules/WhisperEngine.lua"]:261: in function SendSplitMessage' [string "@WIM/Modules/WhisperEngine.lua"]:290: in function fun'
[string "@WIM/Sources/WindowHandler.lua"]:393: in function <WIM/Sources/WindowHandler.lua:385>
[string "@WIM/Sources/WindowHandler.lua"]:709: in function <WIM/Sources/WindowHandler.lua:709>

Locals:
(*temporary) = "|A:Professions-ChatIcon-Quality-Tier3:17:18::1|a]|h|r to R5? "
(*temporary) = "WHISPER"
(*temporary) = nil
(*temporary) = "Snakaso"

The message was:
hey there, can you [Complicated Cuffs |A:Professions-ChatIcon-Quality-Tier3:17:18::1|a] recraft?

If the message starts with [Complicated Cuffs |A:Professions-ChatIcon-Quality-Tier3:17:18::1|a] there isn't any problem.
The bug is always when you have more than 16 single letters before the linked item for example:
1234567890123456[Complicated Cuffs |A:Professions-ChatIcon-Quality-Tier3:17:18::1|a] = bug
123456789012345[Complicated Cuffs |A:Professions-ChatIcon-Quality-Tier3:17:18::1|a] = working

commented

I have the same error.

To create error you just need link item and then write string:
[Draconic Treatise on Tailoring]x3

commented

I'm pretty sure its how large messages are being split. It doesn't look large but there is a lot going on there in the escape codes between the link data and quality indicators. I'll see what I can come up with.

commented

Do me a favor and try the alpha I just posted to curse. See if that fixes it.

(warning -- I didn't get a chance to test it myself)

commented

Hey - Just tested it and it seems like there is another bug now:
1x WIM/Modules/WhisperEngine.lua:270: ChatThrottleLib:SendChatMessage(): message length cannot exceed 255 bytes
[string "=[C]"]: in function error' [string "@BugSack/Libs/AceComm-3.0-12/ChatThrottleLib.lua"]:425: in function SendChatMessage'
[string "@WIM/Modules/WhisperEngine.lua"]:270: in function SendSplitMessage' [string "@WIM/Modules/WhisperEngine.lua"]:300: in function fun'
[string "@WIM/Sources/WindowHandler.lua"]:437: in function <WIM/Sources/WindowHandler.lua:429>
[string "@WIM/Sources/WindowHandler.lua"]:753: in function <WIM/Sources/WindowHandler.lua:753>

Locals:
(*temporary) = "ChatThrottleLib:SendChatMessage(): message length cannot exceed 255 bytes"

the message was:
12345678901234567890[Complicated Cuffs |A:Professions-ChatIcon-Quality-Tier4:17:17::1|a]

commented

Ok revert back to the release version. I'll figure it out tonight it tomorrow

commented

Give the latest alpha a try. I tested it and it appears to be working for me. Let me know if you have any trouble.

commented

Hi, it seems to still show me the error in the latest alpha version (WIM-3.10.7-2-gc4ff0b7).

Screenshot 2023-01-14 154713

It seems to be reproducible when adding multiple item links to the message, making the message so long, that it's required to send it with multiple messages.

commented

It seems that the item links for items with a quality icon look like that: |Hitem:193223::::::::70:252:::::::::|h[Lustrous Scaled Hide |A:Professions-ChatIcon-Quality-Tier2:17:23::1|a]|h|r. It seems that

theMsg, results = string.gsub(theMsg, "(|H[^|]+|h[^|]+|h)", function(theLink)
requires an adjustment for that.

commented

I'm working on a fix. Might send a PR or post an update. ;-)