View Single Post
02/27/20, 07:55 PM   #1
Phuein
 
Phuein's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 132
Post API 100030 and LibChatMessage Overrides

With this patch the chat system has been modified a bit. Some of you may run into issues with the new CHAT_ROUTER. I'll share what fixes one of my addon required, so it may help you with your addon

My addon is used to override the default Friend Login message. The old code:
Code:
ZO_ChatSystem_GetEventHandlers()[EVENT_FRIEND_PLAYER_STATUS_CHANGED] = statusChanged
I had to change it to both update the original table, so that LibChatMessage can use my override, and also the new CHAT_ROUTER. The new code:
Code:
ZO_ChatSystem_GetEventHandlers()[EVENT_FRIEND_PLAYER_STATUS_CHANGED] = statusChanged
CHAT_ROUTER.registeredEventHandlers[EVENT_FRIEND_PLAYER_STATUS_CHANGED] = statusChanged

EVENT_MANAGER:UnregisterForEvent("ChatRouter", EVENT_FRIEND_PLAYER_STATUS_CHANGED)
EVENT_MANAGER:RegisterForEvent("ChatRouter", EVENT_FRIEND_PLAYER_STATUS_CHANGED, statusChanged)
Any feedback is welcome. Enjoy!
  Reply With Quote