package failchat.handlers;

import failchat.core.*;

public class SupportSmileHandler implements MessageHandler {
    private static final String supportSmileMessage = "<img src=\"http://sc2tv.ru/sites/all/modules/sc2tv_streams_donate/images/dollar_small.gif\">";
    private static final Smile supportSmile = new Smile(){
        {
            code = "support_smile";
            source = Source.SC2TV;
        }

        @Override
        public String getImageUrl() {
            return "http://sc2tv.ru/sites/all/modules/sc2tv_streams_donate/images/dollar_small.gif";
        }

        @Override
        public String getFileName() {
            return "dollar_small.gif";
        }

        @Override
        public String getCachePath() {
            return SmileManager.SMILES_DIR_REL.resolve(Source.SC2TV.getLowerCased())
                    .resolve(getFileName()).toString().replace('\\', '/');
        }
    };

    @Override
    public void handleMessage(Message message) {
        if (message.getText().contains(supportSmileMessage)) {
            if (SmileManager.cacheSmile(supportSmile)) {
                message.setText(message.addSmile(supportSmile));
            }

        }
    }
}

@@ -111,158 +111,8 @@
 r %7B%0A
-    private static final String supportSmileMessage = %22%3Cimg src=%5C%22http://sc2tv.ru/sites/all/modules/sc2tv_streams_donate/images/dollar_small.gif%5C%22%3E%22;%0A
     
@@ -765,16 +765,98 @@
 %7D%0A    %7D;
+%0A    private static final String supportSmileMessage = supportSmile.getImageUrl();
 %0A%0A    @O
@@ -955,31 +955,101 @@
 ins(
-supportSmileMessage)) %7B
+%22%3C%22) && message.getText().contains(supportSmileMessage)) %7B //could be faked in funstream chat
 %0A   

Fix for support smile