jpgohlke/twitch-chat-filter — pull request #49 by hugomg (2014-02-25 19:21:40+00:00)
Title: Reachitecture filters to use insert_chat_line

Fixes #44 #46

In an effort to simplify the codebase, I changed the
filtering to occur before the chat lines are inserted
instead of by modifying their HTML. Overall, there was
a reduction of 200 LOC, including the trickiest parts
of the code.

Major behaviour changes:

* All filtering and rewriting now applies to the message
as it was typed by the user in the chat box. The
@message rewriter was the only one that needed to
interact with the HTML so it was removed.

* New messages that trigger an active filter are never
added to the chat queue. If the filter is turned off
in the future those messages are lost forever.

* Old messages already on the chat list that trigger
a recently-activasted filter will have their visibility
toggled on and off as in the old version.

* Old messages that trigger a newly activated rewriter
are not changed (The new rewriters cant interact with the
HTML now)

Minor changes:

* Got rid of some duplicate functionality (allcaps and misty spam)

* Rewriters dont come with custom CSS anymore; Now the rewriter
UI can be handled by the same code that does the filtering UI