Version 1.5 (wotlk only): The addon now visually changes mails from auction house to show sender as either Alliance Auction House or Horde Auction House. In the new core some auction house mails include city in sender name (like Stormwind Auction House), which prevents addons that check auction house mails by sender name from working properly (for example BeanCounter).
Download link in first post updated.
Instead of 2 for loops I'd suggest a simple single table lookup
Code:
local t = {
["Undercity AuctionHouse"] = "Horde Auction House",
--etc
}
return function:
Code:
sender = t[sender] or sender
-
And for the double spaces, just replace them via string.gsub before checking for the actual name.
Code:
sender = string.gsub(sender, " ", "")