Postal
About Postal
Postal offers enhanced mailbox support by providing the following features:
- BlackBook: Adds a contact list next to the To: field.
- Tracks all your characters (as you log each one on) and list them if they are on the same realm/faction on an "Alts" list
- Tracks all your characters (as you log each one on) and list them in the "All Alts" list
- Tracks the last 20 players you mailed on a "Recently Mailed" list.
- Autocomplete names from Alts/Recently Mailed/Contacts/Friends/Guild list. You can choose which of these lists to use.
- Option to autofill in the last person mailed to the To: field.
- Option to disable Blizzard's name auto-completion popup.
- CarbonCopy: Allows you to copy the contents of a mail.
- DoNotWant: Shows a clickable visual icon as to whether a mail will be returned or deleted on expiry.
- Express: Adds shortcuts
- Shift-Click to take item/money from mail
- Ctrl-Click to return mail
- Alt-Click to move an item from your inventory to the current outgoing mail (same as right click in default UI)
- Added option to disable multiple item mail tooltips.
- Forward: Allows you to forward the contents of a mail.
- OpenAll: Allows you to open all mails of selected types at one go in your inbox unattended.
- All AH Cancelled mail
- All AH Expired mail
- All AH Outbidded mail
- All AH Success mail
- All AH Won mail
- Non-AH mail with attachments
- AH settings are divided into neutral and faction-specific settings.
- Shift-Click on the OpenAll button will open all mail and override your filter settings.
- Choose to have a number of bag slots always left free when opening mail.
- QuickAttach: Allows you to quickly attach different trade items types to a mail.
- A default recipient name can be specified by right clicking on a button.
- Which bags are used by this feature can be set in the main menu.
- Rake: Displays summary of money gained from opening mail.
- Select: Adds checkboxes to the inbox with buttons for selective opening/returning
- Added mail indicator numbers above the checkboxes.
- Added help note that you can Shift-Click 2 checkboxes to select everything between them.
- Added help note that you can Ctrl-Click a checkbox to select all mail from that sender.
- Choose to have a number of bag slots always left free when opening mail.
- TradeBlock: Block trades and guild charter signature invites from people while you are at the Inbox.
- Wire: Autoupdate the subject field with money amount if blank.
Postal's menu and settings can be accessed at the upper right corner of your mailbox.
Please post bugs or suggestions at https://www.curseforge.com/wow/addons/postal/issues.
Postal Profiles
While this might not be too intuitive to some users, each character that you log on will have its own initial Postal profile (settings). If you wish that some or all your characters share the same profile (and hence share the same contact list), then you can create a New Profile, call it anything you want such as "Shared by Alts", and have all your other characters change to that profile.
Mass Mailing Abilities
Postal does not come with any abilities to send out mass mails (i.e. messages to more than 1 person at a time). There is no intention to add such functionality to Postal.
Change Logs
Changes from v3.8.0 to v3.9.5
- Merged Postal Classic, BCC, and Retail all into one build.
- Updated some Russian language pack strings (Thanks Hollicsh for the corrections.)
- Added support for WotLK.
- Added support for the new reagent bag for WoW 10.0 release.
- Updated Postal to fully use the new event system for WoW 10.0 release.
- Updated Postal to account for the WotLK classic 3.4.1 changes.
- Code cleanup, and optimization.
Changes from v3.6.9 to v3.7.8
- Added Forward functionality (Issue #94).
- Added QuickAttach functionality
- Allow QuickAttach buttons to autofill in a specific character name automatically (Issue #269).
Changes from v3.5.0 to v3.6.9
- In patch 8.3.0 the mailbox size was increased from 50 to 100. Postal now updated for this change.
- Fixed Express feature ctrl-clicking did not account for soulbound items (Issue #241).
- Alt's list now correctly filters by faction (Issue #238).
- Alt's and All Alt's lists now break into sub lists when they exceed 25 in length, similar to groups and friends list (Issue #116).
- Fixed Lua errors in option to disable Blizzard's name auto-completion popup (Details are in issues #231, #236).
- Added support to disable delay opening of mail (Issue #129).
- Optimized attachment logic for Express sending, by KyrosKrane (Details are in issues #230).
- Updated for 9.1.0
Changes from v3.4.13 to v3.5.0
- Updated for and works with Mists of Pandaria!
- Add Control-Click to attach similar items to Express module, by oscarucb.
- Show buyer/seller name in chat log output when opening AH mails, by jmbarlow.
- Realign buttons properly in MoP.
- Blizzard's guild autocomplete is broken, so we implement our own in the Send name editbox in Blackbook module.
- Fix autocomplete for BattleTag/RealID friends to work.
- Add Italian localization.
Changes from v3.4.12 to v3.4.13
- Add solution (provided by paxi) for mailbox not opening past the first 50 mails for users of other addons that also regularly check the mailbox for changes such as "Tradeskillmaster Mailing".
- Add Brazilian Portugese (ptBR) localization.
Changes from v3.4.10 to v3.4.12
- Updated the TOC number to 40300.
- Apply fix for PTR crash when opening a mail containing more than 2^31 gold, by Cybeloras.
- More accurate timings on when new mail will arrive when someone else is doing CheckInbox() calls, by Mikk.
- Add option to disable having Mr.Plow addon be triggered on opening/returning mails in Select and OpenAll modules. Defaults to On.
Changes from v3.4.9 to v3.4.10
- Updated the TOC number to 40200.
Changes from v3.4.8 to v3.4.9
- Fix "OpenAll.lua:497: 'end' expected (to close 'function' at line 158)" error in v3.4.8.
Changes from v3.4.7 to v3.4.8
- Fix another issue with OpenAll not opening all that resulted from the code simplification.
Changes from v3.4.6 to v3.4.7
- Use a different function to determine if a mail can be returned in the Select module. Should fix return mail issues.
- Simplify OpenAll's mail refreshing code. Fixes the mailbox not auto-refreshing sometimes when you have more mail than 50 to open.
- Add menu option to select which chat window to output Postal's text to. Defaults to ChatFrame1.
- BlackBook will now also record the faction and realm of players you have recently mailed, and only show/use/autocomplete the ones from the same realm/faction as you. This is so that you can use the same profile across multiple servers/factions.
- The recently mailed list is increased in size from 10 to 20 and the list is wiped with this update.
Changes from v3.4.5 to v3.4.6
- If new mails are detected while opening mails, OpenAll will now restart from opening the last mail (in patch 4.0.3, the inbox will now refresh itself on a mailbox change with any new mail if at least 60 seconds has passed).
- Add code to the Select Module to deal with any new mails that might appear at the front of your mailbox at any time, due to flipping inbox pages or a MAIL_INBOX_UPDATE event.
- CheckInbox() behavior changed slightly. It now fires MAIL_INBOX_UPDATE immediately (synchronous) if called within 60 seconds of the last inbox update, but doesn't do it immediately otherwise (asynchronous). Change code in OpenAll module to take this into account to speed up continuing OpenAll by not waiting an extra 10 seconds while doing mailbox refreshes.
Changes from v3.4.4 to v3.4.5
- Fix error that happens when you have no friends on your friends list.
Changes from v3.4.3 to v3.4.4
- Remove RealID friend features from the BlackBook module, along with deleting the realID friend database. Addons are no longer able to obtain real names or any unique realIDs in any manner since patch 4.0.1. Special thanks to Cerala.
Changes from v3.4.2 to v3.4.3
- The Rake module will now properly report the amount of money taken from the mailbox if you right-clicked on the mailbox in the 3D world while it is already open (this bug is new in patch 4.0.1)
- BlackBook module will now add your alt to the alts list on login rather than on visiting the mailbox unless Postal is LoD (due to AddonLoader or otherwise).
- In the OpenAll module, when the mailbox is refreshed during an OpenAll, delay the continuation of OpenAll by 3 seconds to allow for other addons (such as BeanCounter) to do stuff.
Changes from v3.4.0 to v3.4.2
- Fix the annoying error about passing nil to format's #3 argument. The error itself didn't cause any harm, so I didn't tag a release immediately.
- In OpenAll and Select modules, when your bag space is nearly reaching the Keep Free Space setting (1 free above it), Postal will now slow down opening mails to 1 second (if opening speed is below 1 second) to avoid opening mails too quickly and thus avoid going below the Keep Free Space setting. It goes back to opening full speed after you hit the Keep Free Space setting.
- If your inventory is full, OpenAll and Select modules will now loot any items that can combine with any partial stacks in your bags instead of skipping them.
Changes from v3.3.2 to v3.4.0
- Updated for and works with Cataclysm!
- New module CarbonCopy. Allows you to copy the contents of a mail into the clipboard.
- OpenAll module will now really open all your mails - even if you have more than 50 of them. It will now automatically refresh your mailbox and continue opening mails.
- OpenAll and Select modules will stop spamming your chat in verbose mode when your bags are full.
- BlackBook module will now remember your Real ID friend's characters.
- BlackBook module will now show the level and class of your alts, Real ID friends and your guild members in the menus. You may need to log on each alt and visit the mailbox at least once for Postal to remember your alts' level and class.
Changes from v3.3.1 to v3.3.2
- Updated for patch 3.3.5!
- Fix friends list in the BlackBook module. The friends menu dropdown will now show all eligible friends on the same faction and realm that Postal can determine (from friends and RealID).
Changes from v3.3.0 to v3.3.1
- Add option to ignore randoms you interacted with for auto-complete in Blackbook.
- Fix minor bug where "Processing Message 0:" is printed when performing an Open All.
- Fixed unintended bug where Postal allowed CoD amounts larger than 10000g to be sent if the Wire module is active (Blizzard just reduces the CoD amount to 10000g if it was larger). This is now fixed and the default UI behavior to disable the Send button if the amount is larger than 10000g is restored (reported by thefluffyrocker).
Changes from v3.2.2 to v3.3.0
- Updated for patch 3.3!
- Add backward compatibility for MrPlow API function call change.
- Tweak mail opening algorithm so that it won't skip mails when the opening speed is really fast (such as 0.3).
- In BlackBook module, Friends will now auto-complete if Guild disabled and they are in Guild (and vice-versa).
- Raise frame level of some buttons by 1.
- Add workaround to Blizzard's patch 3.3 menu buttons showing behind the menu itself hence they appear disabled.
Changes from v3.2.1 to v3.2.2
- Fix the annoying error about editbox being nil caused by Postman's improper hooking.
- Change the "Please delete some mail..." standard Blizzard message into a more useful one that:
- Shows you how MANY mails remain after the current 50.
- Tells you how long (in seconds) it is until you get to refresh for more.
- Add a setting for "Keep free space", defaults to keeping 1 regular bagslot free in the Select and OpenAll modules. You may need to slow down your opening speed option or leave more empty bag space due to server/client latency.
- Make our BlackBook autocomplete complete before Blizzard's reinstated one. Make the Friends/Guild list BlackBook options affect Blizzard's autocomplete instead in its popup menu (if it is enabled).
- Add an option to turn on or off Postal's auto-complete (default on).
Changes from v3.2.0 to v3.2.1
- Fix the occasional issue where auto-complete will not start working until at least 2 letters are typed.
- Fix the Send button not enabling itself when typing in a name to send to after putting items into the mail first.
Changes from v3.1.2 to v3.2.0
- Updated for patch 3.2!
- TradeBlock module now also blocks guild charter signature invites while the mailbox is open.
- New module: DoNotWant. Shows a clickable visual icon as to whether a mail will be returned or deleted on expiry. Allows fast deleting/returning of mail by clicking the icon (bye Lunar festival mail!). Standard popup warnings will still show for deleting items though.
- Fix name auto-completion in BlackBook module. Now works with Blizzard's one and still retains previous behavior.
- Additionally, you can now choose which lists (Alts/Recent/Contacts/Friends/Guild) Postal will auto-complete names from, as well as disable Blizzard's name auto-completion popup in the BlackBook module options.
- Postal now shows a tooltip containing the mail subject on mouseover if the subject line is too long to fit in the default MailFrame.
- The mailbox will no longer show the silly red "Not all of your mail could be delivered. Please delete some mail to make room." message under our Open and Return buttons in the Select module when you have more than 50 mails. Postal will print it to chat once instead.
Changes from v3.1.1 to v3.1.2
- Hides the minimap unread mail button if there are no unread mail on closing the mailbox. Does not scan past the first 50 items since only the first 50 are viewable.
- Change the opening speed menu to show speeds between 0.3 to 1.0 (with 0.05 steps) and 1.0 to 5.0 (with 0.5 steps). Change the default opening speed from 0.75 to 0.50.
- Add separate OpenAll filters specific to your Faction AH and Neutral AH.
Changes from v3.1.0 to v3.1.1
- Attempt to fix autocomplete in IME char composition mode.
- Fix mouse wheel scrolling in the MailFrame.
- Update passing arguments for some hooks in patch 3.1.
Changes from v3.0.0 to v3.1.0
You are recommended to delete your old Postal folder before installing the new one because it is a Ace3 rewrite and there are a lot of old files and libraries that are no longer needed.
- Framework: Upgraded from Ace2 to Ace3.
- Libraries: DewdropLib is gone. Now uses UIDropDownMenu in the default UI.
- Profile system: Now actually works. The old Postal saved profiles in character specific SVs, so it was useless for copying or sharing.
- Localization: Now uses the wowace localization app at http://www.wowace.com/projects/postal/localization/ to auto-generate the locale files. As such, all 8 locale files are now merged into 1 file since it no longer needs to be maintained manually.
- Slash command /postal: Removed. I don't think anyone used it.
- DejaVu module: Removed. Its functions are now in BlackBook module.
Note: Your old settings (from v3.0.0) are NOT migrated. It should only take at most 30 seconds to look at the 10 or so settings anyway.
In reply to Daxxlia:
thank you this is perfect
In reply to Daxxlia:
Thanks a lot for the fix!
In reply to Daxxlia:
Ty very much, this made it all work perfect again :-)
In reply to Daxxlia:
would not extract for me kept getting an error
In reply to Daxxlia:You did well in fixing all bugs shame u cant take a look at other addons to fix
In reply to Daxxlia:
Thanks, that was a big help!
Here comes a Bug Report about that you can't use the DropBox to choose your Alt's when sending mails.
Date: 2019-10-15 17:02:46
ID: 1
Error occured in: Global
Count: 1
Message: ..\FrameXML\FriendsFrame.lua line 2294:
attempt to index local 'accountInfo' (a number value)
Debug:
..\FrameXML\FriendsFrame.lua:2294: CanCooperateWithGameAccount()
Postal\Modules\BlackBook.lua:370: SortAndCountNumFriends()
Postal\Modules\BlackBook.lua:457: initFunction()
..\FrameXML\UIDropDownMenu.lua:76: UIDropDownMenu_Initialize()
..\FrameXML\UIDropDownMenu.lua:1060:
..\FrameXML\UIDropDownMenu.lua:925
[C]: ?
[C]: ToggleDropDownMenu()
Postal\Modules\BlackBook.lua:41:
Postal\Modules\BlackBook.lua:36
Locals:
accountInfo = 87
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index local 'accountInfo' (a number value)"
playerFactionGroup = "Alliance"
AddOns:
KalielsTracker, v3.1.10
Swatter, v8.2.6377 (SwimmingSeadragon)
AucAdvanced, v8.2.6430 (SwimmingSeadragon)
AucFilterBasic, v8.2.6364 (SwimmingSeadragon)
AucScanData, v8.2.6365 (SwimmingSeadragon)
AucStatHistogram, v8.2.6366 (SwimmingSeadragon)
AucStatiLevel, v8.2.6370 (SwimmingSeadragon)
AucStatPurchased, v8.2.6367 (SwimmingSeadragon)
AucStatSimple, v8.2.6399 (SwimmingSeadragon)
AucStatStdDev, v8.2.6369 (SwimmingSeadragon)
AucUtilFixAH, v8.2.6371 (SwimmingSeadragon)
AutoQuestingTools, v1.1.9
AzeritePowerWeights, v8.2.9
BagBrother, v
Bagnon, v8.2.16
Bartender4, v4.8.8
BeanCounter, v8.2.6422 (SwimmingSeadragon)
DBMArchaeology, v
DBMCore, v8.2.23
DBMDefaultSkin, v
DBMStatusBarTimers, v
EnchantVellum, v1.1.0
ExRT, v4060
FishingBuddy, v1.10.7
HandyNotes, vv1.5.9
HandyNotesFieldPhotographer, v8.0.0.0
HandyNotesHigherLearning, v8.0.0.0
HandyNotesSuramarTelemancy, v1
HandyNotesWellRead, v8.0.0.0
Informant, v8.2.6374 (SwimmingSeadragon)
InstanceAchievementTracker, v2.61.0
kSellGreyNRepair, v1.4
NPCScan, v8.0.1.13
Pawn, v2.3.7
Postal, vv3.6.0
Prat30, v3.7.36
Prat30Libraries, v
Quartz, v3.5.2
RaidRoll, v6.0.0
RaidRollLootTracker, v
Rarity, v1.0 (r692-release)
RarityOptions, v
SimpleRareElite, v1.29
SimpleStatusBars, v
Simulationcraft, v1.12.3
Skada, v1.7.6
SlideBar, v8.2.6375 (SwimmingSeadragon)
Stubby, v8.2.6376 (SwimmingSeadragon)
TomCats, v1.3.6
TomCatsMechagon, v1.3.10
TomCatsNazjatar, v1.3.10
WeakAuras, v2.15.2
WorldBossTimers, vv1.4
xanMortarPestle, v3.2
ZPerl, v5.8.7
ZPerlArcaneBar, v
ZPerlParty, v
ZPerlPartyPet, v
ZPerlPlayer, v
ZPerlPlayerBuffs, v
ZPerlPlayerPet, v
ZPerlRaidAdmin, v
ZPerlRaidFrames, v
ZPerlRaidHelper, v
ZPerlRaidMonitor, v
ZPerlRaidPets, v
ZPerlTarget, v
ZPerlTargetTarget, v
BlizRuntimeLib_enUS v8.2.5.80205 <none>
(ck=768)
THIS ADDON SERIOUSLY NEED AN UPDATE!!!!
Been broken entirely 8.1 + 8.2... now 8.2.5.... and most likely for 8.3+
Привет ) кому нужна работоспособность . просто замените содержимое текста файла в папке (World of Warcraft\_retail_\Interface\AddOns\Postal\Modules) BlackBook.Lua :
local Postal = LibStub("AceAddon-3.0"):GetAddon("Postal")local Postal = LibStub("AceAddon-3.0"):GetAddon("Postal")local Postal_BlackBook = Postal:NewModule("BlackBook", "AceEvent-3.0", "AceHook-3.0")local L = LibStub("AceLocale-3.0"):GetLocale("Postal")Postal_BlackBook.description = L["Adds a contact list next to the To: field."]Postal_BlackBook.description2 = L[ [[|cFFFFCC00*|r This module will list your contacts, friends, guild mates, alts and track the last 10 people you mailed.|cFFFFCC00*|r It will also autocomplete all names in your BlackBook.]] ]
-- luacheck: globals AUTOCOMPLETE_FLAG_ALL AUTOCOMPLETE_FLAG_BNET AUTOCOMPLETE_FLAG_NONE AUTOCOMPLETE_FLAG_FRIEND AUTOCOMPLETE_FLAG_IN_GUILD
local Postal_BlackBookButtonlocal numFriendsOnList = 0local sorttable = {}local ignoresortlocale = { ["koKR"] = true, ["zhCN"] = true, ["zhTW"] = true,}local enableAltsMenu = truelocal enableAllAltsMenu = truelocal Postal_BlackBook_Autocomplete_Flags = { include = AUTOCOMPLETE_FLAG_ALL, exclude = AUTOCOMPLETE_FLAG_BNET,}
function Postal_BlackBook:OnEnable() if not Postal_BlackBookButton then -- Create the Menu Button Postal_BlackBookButton = CreateFrame("Button", "Postal_BlackBookButton", SendMailFrame) Postal_BlackBookButton:SetWidth(25) Postal_BlackBookButton:SetHeight(25) Postal_BlackBookButton:SetPoint("LEFT", SendMailNameEditBox, "RIGHT", -2, 2) Postal_BlackBookButton:SetNormalTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Up") Postal_BlackBookButton:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Round") Postal_BlackBookButton:SetDisabledTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Disabled") Postal_BlackBookButton:SetPushedTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Down") Postal_BlackBookButton:SetScript("OnClick", function(self, button, down) if Postal_DropDownMenu.initialize ~= Postal_BlackBook.BlackBookMenu then CloseDropDownMenus() Postal_DropDownMenu.initialize = Postal_BlackBook.BlackBookMenu end ToggleDropDownMenu(1, nil, Postal_DropDownMenu, self:GetName(), 0, 0) end) Postal_BlackBookButton:SetScript("OnHide", Postal_DropDownMenu.HideMenu) end
local db = Postal.db.profile.BlackBook
SendMailNameEditBox:SetHistoryLines(15) self:RawHook("SendMailFrame_Reset", true) self:RawHook("MailFrameTab_OnClick", true) if db.UseAutoComplete then self:RawHookScript(SendMailNameEditBox, "OnChar") end self:HookScript(SendMailNameEditBox, "OnEditFocusGained") self:RawHook("AutoComplete_Update", true) self:RegisterEvent("MAIL_SHOW") self:RegisterEvent("PLAYER_ENTERING_WORLD", "AddAlt")
local exclude = bit.bor(db.AutoCompleteFriends and AUTOCOMPLETE_FLAG_NONE or AUTOCOMPLETE_FLAG_FRIEND, db.AutoCompleteGuild and AUTOCOMPLETE_FLAG_NONE or AUTOCOMPLETE_FLAG_IN_GUILD) Postal_BlackBook_Autocomplete_Flags.include = bit.bxor( db.ExcludeRandoms and (bit.bor(AUTOCOMPLETE_FLAG_FRIEND, AUTOCOMPLETE_FLAG_IN_GUILD)) or AUTOCOMPLETE_FLAG_ALL, exclude)
-- apply new flag filter to the editbox AutoCompleteEditBox_SetAutoCompleteSource(SendMailNameEditBox, GetAutoCompleteResults, Postal_BlackBook_Autocomplete_Flags.include, Postal_BlackBook_Autocomplete_Flags.exclude)
-- Delete Real ID database. Patch 4.0.1 onwards no longer allows addons to obtain Real ID information. Postal.db.global.BlackBook.realID = nil db.AutoCompleteRealIDFriends = nil
-- Delete old recent data without faction and realm data for i = #Postal.db.profile.BlackBook.recent, 1, -1 do local p, r, f = strsplit("|", Postal.db.profile.BlackBook.recent[i]) if (not r) or (not f) then tremove(Postal.db.profile.BlackBook.recent, i) end end
-- For enabling after a disable Postal_BlackBookButton:Show()end
function Postal_BlackBook:OnDisable() -- Disabling modules unregisters all events/hook automatically SendMailNameEditBox:SetHistoryLines(1) Postal_BlackBookButton:Hide() SendMailNameEditBox.autoCompleteParams = AUTOCOMPLETE_LIST.MAILend
function Postal_BlackBook:MAIL_SHOW() self:RegisterEvent("MAIL_CLOSED", "Reset") self:RegisterEvent("PLAYER_LEAVING_WORLD", "Reset") if self.AddAlt then self:AddAlt() endend
function Postal_BlackBook:Reset(event) self:UnregisterEvent("MAIL_CLOSED") self:UnregisterEvent("PLAYER_LEAVING_WORLD")end
-- We do this once on MAIL_SHOW because UnitFactionGroup() is only valid after-- PLAYER_ENTERING_WORLD and because Postal might be LoD due to AddOnLoader-- and PLAYER_ENTERING_WORLD won't fire in that scenerio.function Postal_BlackBook:AddAlt() local realm = GetRealmName() local faction = UnitFactionGroup("player") local player = UnitName("player") local level = UnitLevel("player") local _, class = UnitClass("player") if not realm or not faction or not player or not level or not class then return end local namestring = ("%s|%s|%s|%s|%s"):format(player, realm, faction, level, class) local db = Postal.db.global.BlackBook.alts enableAltsMenu = false enableAllAltsMenu = false for i = #db, 1, -1 do local p, r, f, l, c = strsplit("|", db[i]) if p == player and r == realm and f == faction then tremove(db, i) end if p ~= player and r == realm and f == faction then enableAltsMenu = true end if p ~= player and r ~= realm then enableAllAltsMenu = true end end tinsert(db, namestring) table.sort(db) self:UnregisterEvent("PLAYER_ENTERING_WORLD") self.AddAlt = nil -- Kill ourselves so we only run it onceend
function Postal_BlackBook.DeleteAlt(dropdownbutton, arg1, arg2, checked) local realm = GetRealmName() local faction = UnitFactionGroup("player") local player = UnitName("player") local db = Postal.db.global.BlackBook.alts enableAltsMenu = false enableAllAltsMenu = false for i = #db, 1, -1 do if arg1 == db[i] then tremove(db, i) else local p, r, f = strsplit("|", db[i]) if r == realm and f == faction and p ~= player then enableAltsMenu = true end if r ~= realm and p ~= player then enableAllAltsMenu = true end end end CloseDropDownMenus()end
-- Only called on a mail that is sent successfullyfunction Postal_BlackBook:SendMailFrame_Reset() local name = strtrim(SendMailNameEditBox:GetText()) if name == "" then return self.hooks["SendMailFrame_Reset"]() end SendMailNameEditBox:AddHistoryLine(name)
local realm = GetRealmName() local faction = UnitFactionGroup("player") if not realm or not faction then return self.hooks["SendMailFrame_Reset"]() end
local namestring = ("%s|%s|%s"):format(name, realm, faction) local db = Postal.db.profile.BlackBook.recent for k = 1, #db do if namestring == db[k] then tremove(db, k) break end end tinsert(db, 1, namestring) for k = #db, 21, -1 do tremove(db, k) end local a, b, c = self.hooks["SendMailFrame_Reset"]() if Postal.db.profile.BlackBook.AutoFill then SendMailNameEditBox:SetText(name) SendMailNameEditBox:HighlightText() end return a, b, cend
function Postal_BlackBook.ClearRecent(dropdownbutton, arg1, arg2, checked) wipe(Postal.db.profile.BlackBook.recent) CloseDropDownMenus()end
function Postal_BlackBook:MailFrameTab_OnClick(button, tab) self.hooks["MailFrameTab_OnClick"](button, tab) if Postal.db.profile.BlackBook.AutoFill and tab == 2 then local realm = GetRealmName() local faction = UnitFactionGroup("player") local player = UnitName("player")
-- Find the first eligible recently mailed for i = 1, #Postal.db.profile.BlackBook.recent do local p, r, f = strsplit("|", Postal.db.profile.BlackBook.recent[i]) if r == realm and f == faction and p ~= player then if p and SendMailNameEditBox:GetText() == "" then SendMailNameEditBox:SetText(p) SendMailNameEditBox:HighlightText() break end end end endend
function Postal_BlackBook:OnEditFocusGained(editbox, ...) -- Most other addons aren't hooking properly and do not pass in editbox at all. SendMailNameEditBox:HighlightText()end
function Postal_BlackBook:AutoComplete_Update(editBox, editBoxText, utf8Position, ...) if editBox ~= SendMailNameEditBox or not Postal.db.profile.BlackBook.DisableBlizzardAutoComplete then self.hooks["AutoComplete_Update"](editBox, editBoxText, utf8Position, ...) endend
-- OnChar fires before OnTextChanged-- OnChar does not fire for Backspace, Delete keys that shorten the text-- Hook player name autocomplete to look in our dbs firstfunction Postal_BlackBook:OnChar(editbox, ...) if editbox:GetUTF8CursorPosition() ~= strlenutf8(editbox:GetText()) then return end
local db = Postal.db.profile.BlackBook local text = strupper(editbox:GetText()) local textlen = strlen(text) local realm = GetRealmName() local faction = UnitFactionGroup("player") local player = UnitName("player") local newname
-- Check all alt list if db.AutoCompleteAllAlts then local nosptext = text:gsub("%s*","") -- ignore spaces in matching fully-qualified names local db = Postal.db.global.BlackBook.alts for i = 1, #db do local p, r, f = strsplit("|", db[i]) if p ~= player and r ~= realm then if strfind(strupper(p.."-"..r):gsub("%s*",""), nosptext, 1, 1) == 1 then newname = p.."-"..r break end end end end
-- Check alt list if db.AutoCompleteAlts then for pass = 1,2 do local db = Postal.db.global.BlackBook.alts for i = 1, #db do local p, r, f = strsplit("|", db[i]) if r == realm and p ~= player and ( (pass == 1 and f ~= faction) or (pass == 2 and f == faction) ) -- prefer same faction, but don't require for alts then if strfind(strupper(p), text, 1, 1) == 1 then newname = p break end end end end end
-- Check recent list if not newname and db.AutoCompleteRecent then local db2 = db.recent for j = 1, #db2 do local p, r, f = strsplit("|", db2[j]) if r == realm and f == faction and p ~= player then if strfind(strupper(p), text, 1, 1) == 1 then newname = p break end end end end
-- Check contacts list if not newname and db.AutoCompleteContacts then local db2 = db.contacts for j = 1, #db2 do local name = db2[j] if strfind(strupper(name), text, 1, 1) == 1 then newname = name break end end end
-- Check RealID friends that are online if not newname and db.AutoCompleteFriends then local numBNetTotal, numBNetOnline = BNGetNumFriends() for i = 1, numBNetOnline do local presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, messageTime, canSoR = BNGetFriendInfo(i) --if (toonName and client == BNET_CLIENT_WOW and CanCooperateWithGameAccount(toonID)) then local accountID = C_BattleNet.GetFriendAccountInfo(i) -- fix if (toonName and client == BNET_CLIENT_WOW and CanCooperateWithGameAccount(accountID)) then -- fix if strfind(strupper(toonName), text, 1, 1) == 1 then newname = toonName break end end end end
-- The Blizzard autocomplete is borked for guild. So we implement our own for guild autocomplete if not newname and db.AutoCompleteGuild and IsInGuild() then local numMembers, numOnline = GetNumGuildMembers(true) for i = 1, numMembers do local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile, canSoR = GetGuildRosterInfo(i) if strfind(strupper(name), text, 1, 1) == 1 then newname = name break end end end
-- Call the original Blizzard function to autocomplete and for its popup self.hooks[SendMailNameEditBox].OnChar(editbox, ...)
-- Set our match if we found one (overriding Blizzard's match if there's one) if newname then editbox:SetText(newname) editbox:HighlightText(textlen, -1) editbox:SetCursorPosition(textlen) endend
function Postal_BlackBook.SetSendMailName(dropdownbutton, arg1, arg2, checked) SendMailNameEditBox:SetText(arg1) if SendMailNameEditBox:HasFocus() then SendMailSubjectEditBox:SetFocus() end CloseDropDownMenus()end
function Postal_BlackBook.AddContact(dropdownbutton, arg1, arg2, checked) local name = strtrim(SendMailNameEditBox:GetText()) if name == "" then return end local db = Postal.db.profile.BlackBook.contacts for k = 1, #db do if name == db[k] then return end end tinsert(db, name) table.sort(db)end
function Postal_BlackBook.RemoveContact(dropdownbutton, arg1, arg2, checked) local name = strtrim(SendMailNameEditBox:GetText()) if name == "" then return end local db = Postal.db.profile.BlackBook.contacts for k = 1, #db do if name == db[k] then tremove(db, k) return end endend
function Postal_BlackBook:SortAndCountNumFriends() wipe(sorttable) local numFriends = GetNumFriends() for i = 1, numFriends do sorttable[i] = GetFriendInfo(i) end
-- Battle.net friends if BNGetNumFriends then -- For pre 3.3.5 backwards compat local numBNetTotal, numBNetOnline = BNGetNumFriends() for i= 1, numBNetOnline do local presenceID, presenceName, battleTag, isBattleTagPresence, toonName, toonID, client, isOnline, lastOnline, isAFK, isDND, messageText, noteText, isRIDFriend, messageTime, canSoR = BNGetFriendInfo(i) --if (toonName and client == BNET_CLIENT_WOW and CanCooperateWithGameAccount(toonID)) then local accountID = C_BattleNet.GetFriendAccountInfo(i) -- fix if (toonName and client == BNET_CLIENT_WOW and CanCooperateWithGameAccount(accountID)) then -- fix -- Check if already on friends list local alreadyOnList = false for j = 1, numFriends do if sorttable[j] == toonName then alreadyOnList = true break end end if not alreadyOnList then numFriends = numFriends + 1 sorttable[numFriends] = toonName end end end end
-- Sort the list if numFriends > 0 and not ignoresortlocale[GetLocale()] then table.sort(sorttable) end
-- Store upvalue numFriendsOnList = numFriends return numFriendsend
function Postal_BlackBook.BlackBookMenu(self, level) if not level then return end local info = self.info wipe(info) if level == 1 then info.isTitle = 1 info.text = L["Contacts"] info.notCheckable = 1 UIDropDownMenu_AddButton(info, level)
info.disabled = nil info.isTitle = nil
local db = Postal.db.profile.BlackBook.contacts for i = 1, #db do info.text = db[i] info.func = Postal_BlackBook.SetSendMailName info.arg1 = db[i] UIDropDownMenu_AddButton(info, level) end
info.arg1 = nil if #db > 0 then info.disabled = 1 info.text = nil info.func = nil UIDropDownMenu_AddButton(info, level) info.disabled = nil end
info.text = L["Add Contact"] info.func = Postal_BlackBook.AddContact UIDropDownMenu_AddButton(info, level)
info.text = L["Remove Contact"] info.func = Postal_BlackBook.RemoveContact UIDropDownMenu_AddButton(info, level)
info.disabled = 1 info.text = nil info.func = nil UIDropDownMenu_AddButton(info, level)
info.hasArrow = 1 info.keepShownOnClick = 1 info.func = self.UncheckHack
info.disabled = #Postal.db.profile.BlackBook.recent == 0 info.text = L["Recently Mailed"] info.value = "recent" UIDropDownMenu_AddButton(info, level)
info.disabled = not enableAltsMenu info.text = L["Alts"] info.value = "alt" UIDropDownMenu_AddButton(info, level)
info.disabled = not enableAllAltsMenu info.text = L["All Alts"] info.value = "allalt" UIDropDownMenu_AddButton(info, level)
info.disabled = Postal_BlackBook:SortAndCountNumFriends() == 0 info.text = L["Friends"] info.value = "friend" UIDropDownMenu_AddButton(info, level)
info.disabled = not IsInGuild() info.text = L["Guild"] info.value = "guild" UIDropDownMenu_AddButton(info, level)
wipe(info) info.disabled = 1 info.notCheckable = 1 UIDropDownMenu_AddButton(info, level) info.disabled = nil
info.text = CLOSE info.func = self.HideMenu UIDropDownMenu_AddButton(info, level)
elseif level == 2 then info.notCheckable = 1 if UIDROPDOWNMENU_MENU_VALUE == "recent" then local realm = GetRealmName() local faction = UnitFactionGroup("player") local player = UnitName("player") local db = Postal.db.profile.BlackBook.recent if #db == 0 then return end for i = 1, #db do local p, r, f = strsplit("|", db[i]) if r == realm and f == faction and p ~= player then info.text = p info.func = Postal_BlackBook.SetSendMailName info.arg1 = p UIDropDownMenu_AddButton(info, level) end end
info.disabled = 1 info.text = nil info.func = nil info.arg1 = nil UIDropDownMenu_AddButton(info, level) info.disabled = nil
info.text = L["Clear list"] info.func = Postal_BlackBook.ClearRecent info.arg1 = nil UIDropDownMenu_AddButton(info, level)
elseif UIDROPDOWNMENU_MENU_VALUE == "alt" then if not enableAltsMenu then return end local db = Postal.db.global.BlackBook.alts local realm = GetRealmName() local faction = UnitFactionGroup("player") local player = UnitName("player") info.notCheckable = 1 for i = 1, #db do local p, r, f, l, c = strsplit("|", db[i]) if r == realm and p ~= player then if l and c then local clr = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[c] or RAID_CLASS_COLORS[c] info.text = format("%s |cff%.2x%.2x%.2x(%d %s)|r", p, clr.r*255, clr.g*255, clr.b*255, l, LOCALIZED_CLASS_NAMES_MALE[c]) else info.text = p end info.func = Postal_BlackBook.SetSendMailName info.arg1 = p UIDropDownMenu_AddButton(info, level) end end
info.disabled = 1 info.text = nil info.func = nil info.arg1 = nil UIDropDownMenu_AddButton(info, level) info.disabled = nil
info.text = L["Delete"] info.hasArrow = 1 info.keepShownOnClick = 1 info.func = self.UncheckHack info.value = "deletealt" UIDropDownMenu_AddButton(info, level)
elseif UIDROPDOWNMENU_MENU_VALUE == "allalt" then if not enableAllAltsMenu then return end local db = Postal.db.global.BlackBook.alts local realm = GetRealmName() local faction = UnitFactionGroup("player") local player = UnitName("player") local plre = player.."-"..realm info.notCheckable = 1 for i = 1, #db do local p, r, f, l, c = strsplit("|", db[i]) local pr = p.."-"..r if (pr ~= plre ) then if l and c then local clr = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[c] or RAID_CLASS_COLORS[c] info.text = format("%s-%s |cff%.2x%.2x%.2x(%d %s)|r", p, r, clr.r*255, clr.g*255, clr.b*255, l, LOCALIZED_CLASS_NAMES_MALE[c]) else info.text = ("%s-%s"):format(p, r) end info.func = Postal_BlackBook.SetSendMailName info.arg1 = ("%s-%s"):format(p, r) UIDropDownMenu_AddButton(info, level) end end
info.disabled = 1 info.text = nil info.func = nil info.arg1 = nil UIDropDownMenu_AddButton(info, level) info.disabled = nil
info.text = L["Delete"] info.hasArrow = 1 info.keepShownOnClick = 1 info.func = self.UncheckHack info.value = "deleteallalt" UIDropDownMenu_AddButton(info, level)
if DropDownList2 then -- ensure long lists stay on screen DropDownList2:SetClampedToScreen(true) end
elseif UIDROPDOWNMENU_MENU_VALUE == "friend" then -- Friends list local numFriends = Postal_BlackBook:SortAndCountNumFriends()
-- 25 or less, don't need multi level menus if numFriends > 0 and numFriends <= 25 then for i = 1, numFriends do local name = sorttable[i] info.text = name info.func = Postal_BlackBook.SetSendMailName info.arg1 = name UIDropDownMenu_AddButton(info, level) end elseif numFriends > 25 then -- More than 25 people, split the list into multiple sublists of 25 info.hasArrow = 1 info.keepShownOnClick = 1 info.func = self.UncheckHack for i = 1, math.ceil(numFriends/25) do info.text = L["Part %d"]:format(i) info.value = "fpart"..i UIDropDownMenu_AddButton(info, level) end end
elseif UIDROPDOWNMENU_MENU_VALUE == "guild" then if not IsInGuild() then return end local numFriends = GetNumGuildMembers(true) for i = 1, numFriends do local name, rank, rankIndex, level, class, zone, note, officernote, online, status, classFileName, achievementPoints, achievementRank, isMobile, canSoR = GetGuildRosterInfo(i) local c = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[classFileName] or RAID_CLASS_COLORS[classFileName] sorttable[i] = format("%s |cffffd200(%s)|r |cff%.2x%.2x%.2x(%d %s)|r", name, rank, c.r*255, c.g*255, c.b*255, level, class) end for i = #sorttable, numFriends+1, -1 do sorttable[i] = nil end if not ignoresortlocale[GetLocale()] then table.sort(sorttable) end if numFriends > 0 and numFriends <= 25 then for i = 1, numFriends do info.text = sorttable[i] info.func = Postal_BlackBook.SetSendMailName info.arg1 = strmatch(sorttable[i], "(.*) |cffffd200") UIDropDownMenu_AddButton(info, level) end elseif numFriends > 25 then -- More than 25 people, split the list into multiple sublists of 25 info.hasArrow = 1 info.keepShownOnClick = 1 info.func = self.UncheckHack for i = 1, math.ceil(numFriends/25) do info.text = L["Part %d"]:format(i) info.value = "gpart"..i UIDropDownMenu_AddButton(info, level) end end end
elseif level >= 3 then info.notCheckable = 1 if UIDROPDOWNMENU_MENU_VALUE == "deletealt" or UIDROPDOWNMENU_MENU_VALUE == "deleteallalt" then local all = ( UIDROPDOWNMENU_MENU_VALUE == "deleteallalt" ) local db = Postal.db.global.BlackBook.alts local realm = GetRealmName() local faction = UnitFactionGroup("player") local player = UnitName("player") for i = 1, #db do local p, r, f, l, c = strsplit("|", db[i]) if p ~= player and ( r == realm or all ) then p = all and p.."-"..r or p if l and c then local clr = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[c] or RAID_CLASS_COLORS[c] info.text = format("%s |cff%.2x%.2x%.2x(%d %s)|r", p, clr.r*255, clr.g*255, clr.b*255, l, LOCALIZED_CLASS_NAMES_MALE[c]) else info.text = p end info.func = Postal_BlackBook.DeleteAlt info.arg1 = db[i] UIDropDownMenu_AddButton(info, level) end end
elseif strfind(UIDROPDOWNMENU_MENU_VALUE, "fpart") then local startIndex = tonumber(strmatch(UIDROPDOWNMENU_MENU_VALUE, "fpart(%d+)")) * 25 - 24 local endIndex = math.min(startIndex+24, numFriendsOnList) for i = startIndex, endIndex do local name = sorttable[i] info.text = name info.func = Postal_BlackBook.SetSendMailName info.arg1 = name UIDropDownMenu_AddButton(info, level) end
elseif strfind(UIDROPDOWNMENU_MENU_VALUE, "gpart") then local startIndex = tonumber(strmatch(UIDROPDOWNMENU_MENU_VALUE, "gpart(%d+)")) * 25 - 24 local endIndex = math.min(startIndex+24, (GetNumGuildMembers(true))) for i = startIndex, endIndex do local name = sorttable[i] info.text = sorttable[i] info.func = Postal_BlackBook.SetSendMailName info.arg1 = strmatch(sorttable[i], "(.*) |cffffd200") UIDropDownMenu_AddButton(info, level) end end
endend
function Postal_BlackBook.SaveFriendGuildOption(dropdownbutton, arg1, arg2, checked) Postal.SaveOption(dropdownbutton, arg1, arg2, checked) local db = Postal.db.profile.BlackBook local exclude = bit.bor(db.AutoCompleteFriends and AUTOCOMPLETE_FLAG_NONE or AUTOCOMPLETE_FLAG_FRIEND, db.AutoCompleteGuild and AUTOCOMPLETE_FLAG_NONE or AUTOCOMPLETE_FLAG_IN_GUILD) Postal_BlackBook_Autocomplete_Flags.include = bit.bxor( db.ExcludeRandoms and (bit.bor(AUTOCOMPLETE_FLAG_FRIEND, AUTOCOMPLETE_FLAG_IN_GUILD)) or AUTOCOMPLETE_FLAG_ALL, exclude)end
function Postal_BlackBook.SetAutoComplete(dropdownbutton, arg1, arg2, checked) local self = Postal_BlackBook Postal.db.profile.BlackBook.UseAutoComplete = not checked if checked then if self:IsHooked(SendMailNameEditBox, "OnChar") then self:Unhook(SendMailNameEditBox, "OnChar") end else if not self:IsHooked(SendMailNameEditBox, "OnChar") then self:RawHookScript(SendMailNameEditBox, "OnChar") end endend
function Postal_BlackBook.ModuleMenu(self, level) if not level then return end local info = self.info wipe(info) info.isNotRadio = 1 if level == 1 + self.levelAdjust then info.keepShownOnClick = 1 info.text = L["Autofill last person mailed"] info.func = Postal.SaveOption info.arg1 = "BlackBook" info.arg2 = "AutoFill" info.checked = Postal.db.profile.BlackBook.AutoFill UIDropDownMenu_AddButton(info, level)
info.hasArrow = 1 info.keepShownOnClick = 1 info.func = self.UncheckHack info.checked = nil info.arg1 = nil info.arg2 = nil info.text = L["Name auto-completion options"] info.value = "AutoComplete" UIDropDownMenu_AddButton(info, level) local listFrame = _G["DropDownList"..level] self.UncheckHack(_G[listFrame:GetName().."Button"..listFrame.numButtons])
elseif level == 2 + self.levelAdjust then local db = Postal.db.profile.BlackBook info.arg1 = "BlackBook"
if UIDROPDOWNMENU_MENU_VALUE == "AutoComplete" then info.text = L["Use Postal's auto-complete"] info.arg2 = "UseAutoComplete" info.checked = db.UseAutoComplete info.func = Postal_BlackBook.SetAutoComplete UIDropDownMenu_AddButton(info, level)
info.func = Postal.SaveOption info.disabled = not db.UseAutoComplete info.keepShownOnClick = 1
info.text = L["Alts"] info.arg2 = "AutoCompleteAlts" info.checked = db.AutoCompleteAlts UIDropDownMenu_AddButton(info, level)
info.text = L["All Alts"] info.arg2 = "AutoCompleteAllAlts" info.checked = db.AutoCompleteAllAlts UIDropDownMenu_AddButton(info, level)
info.text = L["Recently Mailed"] info.arg2 = "AutoCompleteRecent" info.checked = db.AutoCompleteRecent UIDropDownMenu_AddButton(info, level)
info.text = L["Contacts"] info.arg2 = "AutoCompleteContacts" info.checked = db.AutoCompleteContacts UIDropDownMenu_AddButton(info, level)
info.disabled = nil
info.text = L["Friends"] info.arg2 = "AutoCompleteFriends" info.checked = db.AutoCompleteFriends info.func = Postal_BlackBook.SaveFriendGuildOption UIDropDownMenu_AddButton(info, level)
info.text = L["Guild"] info.arg2 = "AutoCompleteGuild" info.checked = db.AutoCompleteGuild UIDropDownMenu_AddButton(info, level)
info.text = L["Exclude randoms you interacted with"] info.arg2 = "ExcludeRandoms" info.checked = db.ExcludeRandoms UIDropDownMenu_AddButton(info, level)
info.text = L["Disable Blizzard's auto-completion popup menu"] info.arg2 = "DisableBlizzardAutoComplete" info.checked = db.DisableBlizzardAutoComplete info.func = Postal.SaveOption UIDropDownMenu_AddButton(info, level) end endend
hi wird Postel nicht Aktualisiert ? seit 8.2.5 tot :(
currently not working, crashes when using drop down menu.
In reply to rfzm:
Hey if you scroll down below there are 2 fixes you can do to one of the lua files and it fixes it entirely as a stopgap until the author can do an official update release. All you do is find the lua file in your program files, open it with the Notepad application, search for the beginning text of the fix.. copy the fixes listed below, paste it over the designated text in the lua file and save and close...
In reply to anniefrell:
This is exactly what I came here for! Thanks so much for the pointer.
8.2.5 killed this.
In reply to notanotherforumname:
Hello,
Scroll down and You can find this fix :
Replace the contents of Postal\Modules\Blackbook.lua with this:
https://pastebin.com/yCCD0mYG
It will be working !
Thank You to Rolnaro for the link!
In reply to potsrabe:
Thanks! Got it working again :D
In reply to potsrabe:
OK not so good with lua stuff unless i know exactly what im doing lol and i guess i don't with this i copied the whole thing on that page and replaced the whole lua because i could not find anything marked Postal\Modules\Blackbook.lua and it did nothing so i am sure i did it wrong soooooooooo can you either paste the whole lua on that page or tell me if i did it right and it just didn't work ????
In reply to potsrabe:
I searched again and found it now to see if it works
No still not working hope so soon i really miss this
Speaking of, does anyone know if the addon author *has* a patreon? I'd be happy to sign up for it!
are u payin him for this to make it an update? are u part of his patreons that supports him with the addon development remember that this addons are from people that try make the game easy in some aspects but u dont know if the addon developer income comes from making addon so he might have his priorities if he has not update the addon since patch 8.0.1 that will tell u that is not gonna get updated soon just cuz u are demanding it FYI