Download
(20 Kb)
Download
Updated: 03/05/20 12:43 PM
Pictures
File Info
Compatibility:
Harrowstorm (5.3.5)
Updated:03/05/20 12:43 PM
Created:02/25/20 03:23 PM
Monthly downloads:56
Total downloads:4,768
Favorites:13
MD5:
Categories:Chat Mods, Miscellaneous
Clean My Chat
Version: 1.2.0
by: Tyx [More]
Clean My Chat

by @Tyx



A small addon for Elder Scrolls Online (no affiliation), to reduce messages in unknown languages from the chat window.



It filters each message if it contains forbidden characters like Spanish ("ñ", "¿", "¡", etc.), Nordic ("ø", "å"), Slavic ("ę", "ł", "ż", etc.), French ("é", "à", "œ", etc.), German (ä, ö, ü, etc.) or Cyrillic (б", "г", "ж", etc.).

You are also able to define your own filtered words or characters. For example, it could be also used to filter swear words not detected by ESO itself.

Settings

If you have the LibAddonMenu-2.0 installed, you will have access to the settings menu to define your own filters and set or unset the filter for predefined characters.

Commands
  • /cmc main command to open setting menu or show current settings
  • /cmc filter shows the defined custom characters
  • /cmc custom toggles the custom character filter
  • /cmc cyrillic toggles the Cyrillic character filter
  • /cmc french toggles the French character filter
  • /cmc german toggles the German character filter
  • /cmc nordic toggles the Nordiccharacter filter
  • /cmc slavic toggles the Slavic character filter
  • /cmc spanish toggles the Spanish character filter
Compatability

It is tested and created to work with pChat or the default chat system.

--------------------
---- 1.2.0 ----
- Added debug command
- Added nordic filter (Danish and Norwegian)
- Added Spanish filter
- Changed hook to latest esoui functions
- Changed settings menu order and tooltips
- Removed large characters from alphabet for optimization
- Improved command output
- Imprived German filter
- Fixed empty statistics menü
- Fixed in-game mail feedback
--------------------
---- 1.1.2 ----
- Changed functions to work again with ESO Update 3.5.3
--------------------
---- 1.1.1 ----
- Changed internal functions to work better with other addons
--------------------
---- 1.1.0 ----
- Added Slavic filter
- Added Channel specific filters
- Added statistics to settings menu
- Fixed issue that the name was filtered not the message
- Implemented pChat compatibility
- Implemented LibDebugLogger
--------------------
Optional Files (0)


Archived Files (3)
File Name
Version
Size
Uploader
Date
1.1.2
19kB
Tyx
03/02/20 11:51 AM
1.1.0
19kB
Tyx
02/26/20 01:28 PM
1.0.0
16kB
02/25/20 03:23 PM


Post A Reply Comment Options
Unread 02/25/20, 04:01 PM  
Crunatus
AddOn Author - Click to view AddOns

Forum posts: 4
File comments: 42
Uploads: 3
Hi! It is compatible with the pChat or rChat addons?
Report comment to moderator  
Reply With Quote
Unread 02/25/20, 04:20 PM  
Tyx
 
Tyx's Avatar
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 83
Uploads: 6
Originally Posted by Crunatus
Hi! It is compatible with the pChat or rChat addons?
I haven't tested it, but it probably is.
What I'm doing is intercepting a broadcast event. If a filter is positive, the broadcast never reaches the chat system. With other addons, it should be as if there never was a message in the first place. A possible conflict could arise if they do the same or wait for the message after a broadcast event has been triggered.
Not sure how pChat works.


EDIT: I tested it with pChat, and it seams to work. At least it doesn't stop pChat from working. I am not sure if any messages were filtered or just not written in the first place , but I didn't see any French, German or Cyrillic while testing. Further "real" testing is necessary to say for sure, but for now: It is likely to be compatible.
Last edited by Tyx : 02/26/20 at 05:18 AM.
Report comment to moderator  
Reply With Quote
Unread 02/26/20, 03:06 AM  
Jojoeso
 
Jojoeso's Avatar

Forum posts: 0
File comments: 44
Uploads: 0
Very useful addon !

Is there a way to pre-define our own list of filtered words and import it in the addon ?
Report comment to moderator  
Reply With Quote
Unread 02/26/20, 05:12 AM  
Tyx
 
Tyx's Avatar
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 83
Uploads: 6
Originally Posted by Jojoeso

Is there a way to pre-define our own list of filtered words and import it in the addon ?

I don't think it is possible to import a pre-made list file. ESO is very restrictive, what is alowed and what not. Any direct interaction with the file system, for example, is not.

What is possible is to copy a list and insert it into the editbox "custom filter" in the in-game settings menu you can open with /cmc if you have LibAddonMenu installed.

Another solution would be to edit your saved variable of this addon directly and insert a table there.
My right now look like this:
Lua Code:
  1. CleanMyChat_Settings =
  2. {
  3.     ["Default"] =
  4.     {
  5.         ["@Tyx"] =
  6.         {
  7.             ["$AccountWide"] =
  8.             {
  9.                 ["cleanCustom"] = false,
  10.                 ["customFilter"] =
  11.                 {
  12.                 },
  13.                 ["cleanFrench"] = true,
  14.                 ["cleanCyrillic"] = true,
  15.                 ["cleanGerman"] = false,
  16.                 ["version"] = 1,
  17.             },
  18.         },
  19.     },
  20. }
What you could do is insert your own list into the "customFilter" table like this:
Lua Code:
  1. ["customFilter"] =
  2.     {
  3.         "word1", "word2", "word3"
  4.     },
For this solution to work, you have to at least be logged out. If the game is active running, the saved variable file will be overwritten. You can find this File in ~\Documents\Elder Scrolls Online\Live\SavedVariables\CleanMyChat.lua.
Report comment to moderator  
Reply With Quote
Unread 02/26/20, 06:56 AM  
Jojoeso
 
Jojoeso's Avatar

Forum posts: 0
File comments: 44
Uploads: 0
Thanks. I'll import my looong list of german words in the Customfilter section then
Report comment to moderator  
Reply With Quote
Unread 02/26/20, 07:43 AM  
Tyx
 
Tyx's Avatar
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 83
Uploads: 6
I have made a mistake with the input. Strangly it worked yesterday, but today I noticed, that the chat message is on parameter 3 not 2. Right now it filters the name of the writer not the message. Working on a fix right now and will upload it soon. Will also write a compatibility fix for pChat because it overwrites the same functions as this addon.
Last edited by Tyx : 02/26/20 at 07:44 AM.
Report comment to moderator  
Reply With Quote
Unread 02/26/20, 08:22 AM  
FWSWBN
 
FWSWBN's Avatar

Forum posts: 18
File comments: 489
Uploads: 0
Looks like it doesnt work.
I use the option "cyrillic" and it shows again the cyrillic letters.
I use also pChat, maybe this is the problem.


Only for info, no complain
Report comment to moderator  
Reply With Quote
Unread 02/26/20, 01:33 PM  
Tyx
 
Tyx's Avatar
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 83
Uploads: 6
Originally Posted by FWSWBN
Looks like it doesnt work.

Updated version is now online. It should work now. I tested it half the day and it successfully hide any messages with unwanted characters from the normal chat and pChat.
Report comment to moderator  
Reply With Quote
Unread 02/27/20, 04:20 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4991
File comments: 6045
Uploads: 78
Thanks for this addon, very handy!

Your manifest file contains "SlowDialogs" as info
And you can handle multiple ## DependsOn or ## OptionalDependsOn in one line, using spaces in between:

Code:
## OptionalDependsOn: LibAddonMenu-2.0 LibFeedback LibDebugLogger pChat
And instead of "overwriting" my pChat function please use the proper ZO_PreHook function to prehook, it instead to keep other addons alive and running if they also prehook it.
Else: If other addons are not added to your "OptionalDependsOn" list they will most likely be loaded after your addon and their prehooks won't work properly anymore as you have overwritten and captured the function for your addon.

Lua Code:
  1. --- Function intercepts pChat FormatMessage (3457) and mimics its spam detection
  2. ZO_PreHook(pChat, "FormatMessage", function(...)
  3.         if self:MessageNeedsToBeRemoved(nil, ...) then
  4.           return true --return true: The PreHook will end here and not call original function's code
  5.         end
  6.     end)

Btw:
You are lucky I had to expose the function pChat.FormatMessage in my last update Before it was local for some reasons:
I hope this works properly with pChat's chat history.
pChat internally adds chat messages to the savedvariables and internal tables db.LineStrings so you can see them after a logout e.g. again (if enabled in the settings).
I think all is "added" inside function FormatMessage but if something changes the table before already and then the function FormatMessage is never called, this could cause some problems.
Last edited by Baertram : 02/27/20 at 04:28 AM.
Report comment to moderator  
Reply With Quote
Unread 02/27/20, 07:02 AM  
Tyx
 
Tyx's Avatar
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 83
Uploads: 6
Originally Posted by Baertram
Your manifest file contains "SlowDialogs" as info
Haha, copy and paste strikes back.

Thank you very much for the many and detailed explanations! I knew nothing about hooks in ESO. I will update my addon soon to work better with others. Maybe I will try to implement it in the original way again, so that every chat broadcast is intercepted. I think this would also prevent pChat from noticing that a message has been sent at all, and thus will prevent the message to be added to the history.

I still have to do some tests, but the update will come soon.
Report comment to moderator  
Reply With Quote
Unread 02/27/20, 08:54 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4991
File comments: 6045
Uploads: 78
Originally Posted by Tyx
so that every chat broadcast is intercepted
This sounds like overwriting the chat stuff in total, otherwise I couldn't think of a proper way to intercept all messages I bet you raise more trouble with this then

btw:
Currently ZOs introduced some problems to the chat so that formatters and other events are not working properly for multiple addons. This most likely results in multiple chat addons having trouble using the same events (formatters, group left, joined, etc.).
I hope they will fix this soon. Otherwise each addon will overwrite the other again, and only 1 may work properly.
Report comment to moderator  
Reply With Quote
Unread 02/28/20, 01:34 AM  
Jojoeso
 
Jojoeso's Avatar

Forum posts: 0
File comments: 44
Uploads: 0
I get this error message each time someone whispers to me


https://imgur.com/a/i5rSCXa
Last edited by Jojoeso : 02/28/20 at 01:35 AM.
Report comment to moderator  
Reply With Quote
Unread 02/28/20, 04:14 AM  
Tyx
 
Tyx's Avatar
AddOn Author - Click to view AddOns

Forum posts: 23
File comments: 83
Uploads: 6
Originally Posted by Baertram
This sounds like overwriting the chat stuff in total, otherwise I couldn't think of a proper way to intercept all messages I bet you raise more trouble with this then
You're probably right. Everything feels so hacky and insecure when there is no real testing possibility and no documentation. I will implement it with the hook, as you have previously said. This should do the job nicely without affecting your fantastic addon too much. After testing it looks like it works well with the history function as well. But if a message has already been saved, it won't be filtered again and therefore displayed.
Originally Posted by Baertram
Currently ZOs introduced some problems to the chat so that formatters and other events are not working properly for multiple addons.
I noticed. I guess I choose the worst moment to create a chat addon

It is also very annoying that I can't find a way to hook to the normal chat function, called by the "ChatRouter" event, without reregistering it. It should be possible from what I understand, but for some reason, possibly from my lack of understanding hooks or the eso code base, the hook doesn't get called:
Lua Code:
  1. -- module esoui.ingame.chatsystem.chathandlers
  2. self.registeredEventHandlers[eventCode] = OnChatEvent
  3. EVENT_MANAGER:RegisterForEvent("ChatRouter", eventCode, OnChatEvent)
  4.  
  5.  
  6. -- my hook which doesn't work
  7. ZO_PreHook(CHAT_ROUTER.registeredEventHandlers, EVENT_CHAT_MESSAGE_CHANNEL, function(...)
  8.         return self:MessageNeedsToBeRemoved(nil, ...)
  9.     end)


Originally Posted by Jojoeso
I get this error message each time someone whispers to me
Thank you very much for reporting this.
It seems to be due to some API changes in the last ESO update. I will try to circumvent this in some way in the next update.
Report comment to moderator  
Reply With Quote
Unread 02/29/20, 06:29 AM  
FWSWBN
 
FWSWBN's Avatar

Forum posts: 18
File comments: 489
Uploads: 0
Originally Posted by Tyx
Updated version is now online. It should work now. I tested it half the day and it successfully hide any messages with unwanted characters from the normal chat and pChat.
Thx, working (for me).
I dont see any cyrillic letters in my chat.
Also no errors anymore (lua).

thx for the fix


EDIT:
also whisper works without any errors or problems <--- only for info

(german client and german language and also some other languages (I speak much more than one).


EDIT 2:
@Baetram..... I use it with pchat and wykkyd enhanced chat <--- only for info
Last edited by FWSWBN : 02/29/20 at 06:33 AM.
Report comment to moderator  
Reply With Quote
Unread 02/29/20, 10:57 AM  
wyvie

Forum posts: 0
File comments: 3
Uploads: 0
Everything works for me, cyrillic it completely blocked, but when somebody whispers me, I get popup with following error.

EsoUI/Ingame/ChatSystem/Keyboard/KeyboardChatSystem.lua:407: Attempt to access a private function 'FlashTaskbarWindow' from insecure code. The callstack became untrusted 4 stack frame(s) from the top.
stack traceback:
EsoUI/Ingame/ChatSystem/Keyboard/KeyboardChatSystem.lua:407: in function 'ZO_ChatSystem:OnFormattedChatMessage'
EsoUI/Ingame/ChatSystem/SharedChatSystem.lua:1447: in function 'OnFormattedChatMessage'
EsoUI/Libraries/Utility/ZO_CallbackObject.lua:116: in function 'ZO_CallbackObject:FireCallbacks'
EsoUI/Ingame/ChatSystem/ChatHandlers.lua:213: in function 'OnChatEvent'
(tail call): ?
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.