diff --git a/AtlasLoot/Core/WishList.lua b/AtlasLoot/Core/WishList.lua index 871225a..b6ce6ec 100644 --- a/AtlasLoot/Core/WishList.lua +++ b/AtlasLoot/Core/WishList.lua @@ -971,14 +971,29 @@ function AtlasLoot_GetWishList(wlstrg,sendername) local success, wltab = ALModule:Deserialize(wlstrg); if success then for i,v in ipairs(wltab) do - v[8] = v[8].."|"..v[9].."|"..v[10]; - table.remove(v,9) - table.remove(v,10) + if v[8] then + v[8] = v[8].."|"..v[9].."|"..v[10]; + table.remove(v,9) + table.remove(v,10) + end end table.insert(AtlasLootWishList["Shared"],wltab) end end +local EscapePatterns={ + "|[cC]%x%x%x%x%x%x"; + "|T[^|]+|t"; + "|H[^|]+|h%[(.-)%]|h"; +}; + +local function StripEscapes(str) + for _,pattern in ipairs(EscapePatterns) do + str=str:gsub(pattern,pattern:find("%(.-[^%%]%)") and "%1" or ""); + end + return str:gsub("^%s*(.-)%s*$","%1"):gsub("%s+"," ");-- Strip extra spaces +end + --[[ ALModule:OnCommReceived(prefix, message, distribution, sender) Incomming messages from AceComm @@ -993,11 +1008,13 @@ function ALModule:OnCommReceived(prefix, message, distribution, sender) elseif message == "AcceptWishlist" then local wsltable = AtlasLoot:CloneTable(_G[curtable[2]][curtable[1]][curtable[3]]); for i,v in ipairs(wsltable) do - v[4] = "" - local dataID, dataSource, dataPage = strsplit("|", v[8]) - v[8] = dataID; - v[9] = dataSource; - v[10] = dataPage; + v[4] = gsub(StripEscapes(v[4]),"FF",""); + if v[8] then + local dataID, dataSource, dataPage = strsplit("|", v[8]) + v[8] = dataID; + v[9] = dataSource; + v[10] = dataPage; + end end local sendData = ALModule:Serialize(wsltable); ALModule:SendCommMessage("AtlasLootWishlist", sendData, "WHISPER", sender); diff --git a/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua b/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua index d63dbf9..52b501c 100644 --- a/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua +++ b/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua @@ -148,7 +148,7 @@ function AtlasLoot:DewdropExpansionMenuClick(expansion, name) else local tablenum = AtlasLoot_Data[tablename].Loadfirst or 1; AtlasLoot:ShowItemsFrame(tablename, "AtlasLoot_Data", tablenum); - end + end end end