jpgohlke / twitch-chat-filter

58 stars 37 forks source link

Messaged get unfiltered when user sends a message #156

Open Zephymastyx opened 10 years ago

Zephymastyx commented 10 years ago

When first loading the script, messages that don't meet the filter criteria just get hidden. With the new chat, hidden messages reappear whenever the user send a message. I tried rerunning the filter in Room_proto.send, but apparently the chatlines get unhidden in a different function.

We could either try to find the twitch function that unhides chat lines, or just run .delete() instead of .toggle(false) to hide chat lines. This prevents the user from "recovering" messages by unsetting a filter, but since that only applies to messages sent before the filter is initialized, I don't think that really matters.

hugomg commented 10 years ago

I think recovering hidden chat messages is a useful way for users to learn what the filters do. They can toggle back and forward to see the difference. This hiding also happens whenever you change settings so I don't think we can dismiss it as a "just when loading the page" feature.

I couldn't reproduce the bug myself (when I type a new message the hidden ones stay hidden) but, assuming that Twitch is just unhiding messages instead of recreating the divs, perhaps a better way would be to add our own CSS class to the hidden lines instead of setting display=none?

jpgohlke commented 10 years ago

Performing some house cleaning on the project (finally!). Is this bug still an issue or replicable?

Zephymastyx commented 10 years ago

It still occurs for me. It is best replicable in the betting phase when the bank bot is active. Let it spam some balances, load the filter (only after the messages that will be filtered appear) -> bank bot messages disappear, send a message -> bank bot message reappear. The chat also scrolls back up as it happens, so it is still an issue for me.

suggestion of hugomg to add a css class to hidden messages will probably work and shouldnt be too much work, I just didnt get to try it myself.