<commit_before>package im.actor.core.js.providers.electron;

public class JsElectronApp {

    public static native boolean isElectron()/*-{
        return 'require' in $wnd;
    }-*/;

    public static native void bounce()/*-{
        var ipc = $wnd.require("electron").ipcRenderer;
        ipc.send('tray-bounce');
    }-*/;

    public static native void hideNewMessages()/*-{
        var ipc = $wnd.require("electron").ipcRenderer;
        ipc.send('new-messages-hide');
    }-*/;

    public static native void updateBadge(int count)/*-{
        var ipc = $wnd.require("electron").ipcRenderer;
        ipc.send('tray-badge', { count: count });
    }-*/;


    public static native void subscribe(String topic, JsElectronListener listener)/*-{
        var ipc = $wnd.require("electron").ipcRenderer;
        ipc.on(topic, function(message) {
            listener.@im.actor.core.js.providers.electron.JsElectronListener::onEvent(*)(message);
        });
    }-*/;

    public static native void openUrlExternal(String url)/*-{
        var shell = $wnd.require('electron').shell;
        shell.openExternal(url);
    }-*/;
}<commit_msg>fix(js): Fixing event receiving<commit_after>package im.actor.core.js.providers.electron;

public class JsElectronApp {

    public static native boolean isElectron()/*-{
        return 'require' in $wnd;
    }-*/;

    public static native void bounce()/*-{
        var ipc = $wnd.require("electron").ipcRenderer;
        ipc.send('tray-bounce');
    }-*/;

    public static native void hideNewMessages()/*-{
        var ipc = $wnd.require("electron").ipcRenderer;
        ipc.send('new-messages-hide');
    }-*/;

    public static native void updateBadge(int count)/*-{
        var ipc = $wnd.require("electron").ipcRenderer;
        ipc.send('tray-badge', { count: count });
    }-*/;


    public static native void subscribe(String topic, JsElectronListener listener)/*-{
        var ipc = $wnd.require("electron").ipcRenderer;
        ipc.on(topic, function(event, message) {
            listener.@im.actor.core.js.providers.electron.JsElectronListener::onEvent(*)(message);
        });
    }-*/;

    public static native void openUrlExternal(String url)/*-{
        var shell = $wnd.require('electron').shell;
        shell.openExternal(url);
    }-*/;
}
{'fraction_non_alphanumeric': 0.15979157620495008, 'fraction_numerical': 0.0, 'mean_word_length': 2.7708674304418985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7595248', 'n_tokens_mistral': 766, 'n_tokens_neox': 698, 'n_words': 140}