Thread Tools Display Modes
05/31/21, 01:47 PM   #1
siruker
Join Date: May 2021
Posts: 4
Modifying chat messages

ok so I want to delete chat message. I have code that listens to chat event and i can get the message data.
How would one go about deleting/hiding it.

I foud this old post but lib is deprecated that was used in this example https://www.esoui.com/forums/showthr...ghlight=BUFFER

Last edited by siruker : 05/31/21 at 01:50 PM.
  Reply With Quote
05/31/21, 02:28 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,966
Check the MANY existing addons that filter chat messages or suppress chat spam and advertisements, e.g.:
https://www.esoui.com/downloads/info...sSpamMore.html
https://www.esoui.com/downloads/info...ementSpam.html
https://www.esoui.com/downloads/info...hatFilter.html

Important:
If you use CHAT_ROUTER and add a prehook, or register a function for "FormatAndAddChatMessage":

Be aware that registering some chat handlers will overwrite other addon's chat handlers! Currently you can only register 1 message handler to the chat messages so writing an addon which does this might destroy other chat addons like pChat/rChat etc.
If you preHook, like Cyrillic Chat Filter dies, the function "FormatAndAddChatMessage" be sure to make your addon dependend on those public addons so that the other addons load first (by using ## OptionalDependsOn: pChat rChat) AND by registering your stuff at EVENT_PLAYER_ACTIVATED instead of EVENT_ADD_ON_LOADED (as pChat/rChat start to register their addon chat functions there!) AND test if your addon breaks the other addons and say so in your description.
Also test if this destroys the chat history of the other addons as they might store the chat message that you have blocked/deleted already somewhere internally and after that you delete the message -> indices are f**ed up!

Thank you

Last edited by Baertram : 05/31/21 at 02:32 PM.
  Reply With Quote
05/31/21, 11:44 PM   #3
siruker
Join Date: May 2021
Posts: 4
Originally Posted by Baertram View Post
Check the MANY existing addons that filter chat messages or suppress chat spam and advertisements, e.g.:
https://www.esoui.com/downloads/info...sSpamMore.html
https://www.esoui.com/downloads/info...ementSpam.html
https://www.esoui.com/downloads/info...hatFilter.html

Important:
If you use CHAT_ROUTER and add a prehook, or register a function for "FormatAndAddChatMessage":

Be aware that registering some chat handlers will overwrite other addon's chat handlers! Currently you can only register 1 message handler to the chat messages so writing an addon which does this might destroy other chat addons like pChat/rChat etc.
If you preHook, like Cyrillic Chat Filter dies, the function "FormatAndAddChatMessage" be sure to make your addon dependend on those public addons so that the other addons load first (by using ## OptionalDependsOn: pChat rChat) AND by registering your stuff at EVENT_PLAYER_ACTIVATED instead of EVENT_ADD_ON_LOADED (as pChat/rChat start to register their addon chat functions there!) AND test if your addon breaks the other addons and say so in your description.
Also test if this destroys the chat history of the other addons as they might store the chat message that you have blocked/deleted already somewhere internally and after that you delete the message -> indices are f**ed up!

Thank you
Will do tnx.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Modifying chat messages


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off