sylvanaar / wow-instant-messenger

WIM (WoW Instant Messenger) is a World of Warcraft addon which brings an instant messenger feel to communication in game.
https://www.curseforge.com/wow/addons/wim-3
MIT License
12 stars 14 forks source link

Incompatibility with WeakAuras links #39

Closed mrbuds closed 3 years ago

mrbuds commented 3 years ago

Describe the bug Clicking a WeakAuras link sent in whisper using WIM show error "Malformed WeakAuras link"

To Reproduce

Disable WIM solve issue.

Expected behavior

Screenshots image

Additional context Tested with last alpha version of WIM and current release version of WeakAuras

Code that filter chat and create link : https://github.com/WeakAuras/WeakAuras2/blob/dcd0776c2c5628ad1ed3bbb650120098b2c1a3fe/WeakAuras/Transmission.lua#L156

SetItemRef hook: https://github.com/WeakAuras/WeakAuras2/blob/dcd0776c2c5628ad1ed3bbb650120098b2c1a3fe/WeakAuras/Transmission.lua#L622

TorunR commented 3 years ago

Replacing RegisterWidgetTrigger in Sources/WindowHandler.lua starting from line 1908 with the following fixes this for me.

RegisterWidgetTrigger("chat_display", "whisper,chat,w2w", "OnHyperlinkClick", function(self, link, text, button)
    local t,n,i = string.split(":", link)
    if n == myself then
        return
        end
        if link == "garrmission:weakauras" then
                _G.SetItemRef(link, text, button, self);
        else
                _G.SetItemRef(link, text:gsub("|c%x%x%x%x%x%x%x%x", ""):gsub("|r", ""), button, self);
        end
end);