- Classic HC realms / Classic Era 1.15.x broken after 4.0.3: Classic clients (e.g. 1.15.8) have
EventRegistrybackported but do not fire theChatFrame.OnEditBoxPreSendTextevent — that event is exclusive to Retail Patch 12.0.0 (Midnight/TWW). Because the oldif EventRegistry thencheck was satisfied, theChatFrameEditBoxMixin.SendTextfallback was never reached and the hook was completely silent. Fixed by gating theEventRegistrypath onGetBuildInfo()interface version ≥ 120000. Classic clients now correctly use theChatFrameEditBoxMixin.SendTexthook.
- Chat blocked during combat (ADDON_ACTION_FORBIDDEN): When the player was in combat lockdown (raid, M+, PvP zones), calling
editBox:SetText()inside theChatFrame.OnEditBoxPreSendTextcallback tainted the protectedSendChatMessage()call that followed — causing the Blizzard combat popup to appear and the message to be fully blocked (issue #33)- Fix: Added an
InCombatLockdown()check at the start ofModifyChatMessage(). During combat the function returns immediately without touching the EditBox, so the message is sent as-is (without name prefix) without any error - Trade-off: The name prefix cannot be added during combat — this is an unavoidable Blizzard engine restriction that affects all chat-modifying addons (e.g., Prat) since Midnight/TWW
- Fix: Added an
- Raid chat inside instances not working: In WoW instances (raids, LFR, battlegrounds),
/raidchat is routed by the game asINSTANCE_CHATinstead ofRAID. Enabling "Raid" in the addon settings now also coversINSTANCE_CHATautomatically. - Officer chat (
/o) not covered: Added explicit handling forOFFICERchat type under the guild setting (which already documented/g and /oin its description). - Name not being prepended to messages (critical fix): Found and resolved root cause
- Previous approaches (
ChatEdit_SendText,ChatFrameEditBoxMixin.SendText) were bypassed because Blizzard completely rearchitected the chat send path in Patch 12.0.0 - The correct hook point is now
EventRegistry:RegisterCallback("ChatFrame.OnEditBoxPreSendText", ...) - Blizzard included this event explicitly for addons: "Notification for user addons to perform any final edits to chat text contents before sending." (source:
ChatFrameEditBox.luainBlizzard_ChatFrameBase) - The event fires after
ParseText()(chatType already resolved, e.g./g→"GUILD") but beforeGetText()is called for the send — soSetText()still affects the outgoing message - Hook confirmation
Name2Chat: Hook active (ChatFrame.OnEditBoxPreSendText)is always printed on load
- Previous approaches (
- Updated for WoW Patch 12.0.0 API changes:
ChatEdit_SendTextis now a deprecated alias only loaded whenloadDeprecationFallbacksCVar is set — no longer reliable as a hook target- Added support for new
ADDON_RESTRICTION_STATE_CHANGEDevent - Added monitoring for
addonChatRestrictionsForcedCVar - Enhanced error handling to work with the new "Secret Values" system
- Added
pcallprotection around chat modification code
- Enhanced Error Handling: Added debug output at every decision point in
ModifyChatMessage()— disabled/empty name/unsupported chat type are all now logged when debug mode is active - Better User Feedback: Warns if addon chat restrictions are enforced
- Cross-Version Support: Works on all WoW versions (Retail 12.0+, Classic variants) via EventRegistry primary hook and
ChatFrameEditBoxMixin.SendTextfallback
- All hardcoded strings moved to AceLocale-3.0: Every visible string (UI labels, debug messages, status output) is now fully localized
- Translations added for all supported languages: deDE, esES, esMX, frFR, itIT, koKR, ptBR, ruRU, zhCN, zhTW
- Note: All translations except
enUSare AI-generated and may contain inaccuracies. Community corrections are welcome via CurseForge or the GitHub repository.
HookChatSendFunction(): Switched primary hook toEventRegistrycallback;ChatFrameEditBoxMixin.SendTextkept as fallback for Classic/older clientsModifyChatMessage(): AddedSafe_Printdebug output at every early-return and decision pointOnAddonRestrictionChanged(): New event handler for Patch 12.0.0 chat restrictions- Removed unused libraries from
embeds.xml:AceComm-3.0,AceSerializer-3.0,AceTab-3.0,AceTimer-3.0
- ChatCompat Abstraction Layer: New mini-library for unified Chat API management
- Automatic feature detection for Retail/Classic APIs
- Centralized handling of all version differences
- Reusable for other addons via LibStub
- SendChatMessage Hook Recursion: Prevented re-entrance that caused "script ran too long" errors when sending chat messages
- Calls the stored original API instead of the hooked wrapper
- Fixes execution stall on message send across all supported clients
- ChatCompat LibStub Registration: Fixed critical error "attempt to call method 'HookSendChatMessage' (a nil value)"
- Corrected LibStub registration mechanism in
ChatCompat.lua - Proper function copying to library table
- Addon now loads correctly on all WoW versions
- Corrected LibStub registration mechanism in
- Code Refactoring: Use of ChatCompat for clean API abstraction
- Removal of redundant Retail/Classic checks
- Simplified hook mechanism
- Better maintainability and readability
- TOC Format Update: Consolidated to modern single-interface format (Patch 10.2.7+)
- Added
LoadSavedVariablesFirst - Added
AllowAddOnTableAccessfor C_AddOns compatibility
- Added
- Documentation: Thorough commenting for Copilot-friendly structure
- New file:
ChatCompat.luafor API abstraction layer - Updated
Name2Chat.luato use ChatCompat - Updated
embeds.xmlto load ChatCompat - Simplified hook management via
ChatCompat:HookSendChatMessage()
- Patch 12.0.1 (Midnight) Support: Updated for WoW Patch 12.0.1 (Interface 120001)
- Full Classic Compatibility: Added comprehensive support for all WoW variants
- Classic Era (Interface 11508)
- Season of Discovery
- TBC Classic (Interface 20504)
- Wrath Classic (Interface 30403)
- Cata Classic (Interface 40400)
- Enhanced Version Detection: Automatic detection of all WoW client types
- Improved API Handling:
- Smart detection between modern
C_ChatInfo.SendChatMessage(Retail) and legacySendChatMessage(Classic variants) - Robust error handling with pcall protection
- Automatic fallback mechanisms for API compatibility
- Smart detection between modern
- Better Logging:
- Detailed client type identification in debug messages
- Shows exact WoW version being used (e.g., "Classic Era", "TBC Classic", "Midnight 12.0.1+")
- Interface version displayed in all log messages
- Patch 12.0.0 Compatibility: Ready for Secret Values system introduced in Midnight expansion
- Added version compatibility constants for all WoW variants (IS_RETAIL, IS_CLASSIC, IS_TBC, IS_WRATH, IS_CATA)
- Improved hook initialization with pcall error protection
- Enhanced version string generation for different client types
- Updated comments to reflect Patch 12.0.0/12.0.1 API changes
- Added AceDB-3.0
- Updated TOC for prepatch 2
- Re-added all libs to prevent errors
- Removed space after Name