from retail

This commit is contained in:
NoM0Re
2025-01-09 17:17:53 +01:00
parent 55709443ae
commit aee89075c9
8 changed files with 67 additions and 45 deletions
+12 -7
View File
@@ -302,19 +302,24 @@ function StringToTable(inString, fromChat)
end
if not decoded then
return "Error decoding."
return L["Error decoding."]
end
local decompressed, errorMsg = nil, "unknown compression method"
local decompressed
if encodeVersion > 0 then
decompressed = LibDeflate:DecompressDeflate(decoded)
if not(decompressed) then
return L["Error decompressing"]
end
else
decompressed, errorMsg = Compresser:Decompress(decoded)
end
if not(decompressed) then
return "Error decompressing: " .. errorMsg
-- We ignore the error message, since it's more likely not a weakaura.
decompressed = Compresser:Decompress(decoded)
if not(decompressed) then
return L["Error decompressing. This doesn't look like a WeakAuras import."]
end
end
local success, deserialized
if encodeVersion < 2 then
success, deserialized = Serializer:Deserialize(decompressed)
@@ -322,7 +327,7 @@ function StringToTable(inString, fromChat)
success, deserialized = LibSerialize:Deserialize(decompressed)
end
if not(success) then
return "Error deserializing "..deserialized
return L["Error deserializing"]
end
return deserialized
end