• Andrew Price's avatar
    Add mw_logon, mw_logoff, talker_join and talker_leave mwjs events · ccde2b85
    Andrew Price authored
    Required a lot of IPC_CHECKONOFF-related changes and tidy-ups.
    New js events handled like so:
    
        function handler(ev)
        {
                switch(ev.type) {
                case "mw_logon":
                        d = ev.data;
                        mw.print("d.user: " + d.user);
                        mw.print("d.quiet: " + d.quiet);
    
                        mw.print("d.autochat: " + d.autochat);
                        break;
                case "mw_logoff":
                        d = ev.data;
                        mw.print("d.user: " + d.user);
                        mw.print("d.method: " + d.method);
                        mw.print("d.quiet: " + d.quiet);
    
                        mw.print("d.reason: " + d.reason);
                        mw.print("d.agent: " + d.agent);
                        break;
                case "talker_join":
                        d = ev.data;
                        mw.print("d.user: " + d.user);
                        mw.print("d.method: " + d.method);
                        mw.print("d.quiet: " + d.quiet);
    
                        mw.print("d.channel: " + d.channel);
                        mw.print("d.agent: " + d.agent);
                        break;
                case "talker_leave":
                        d = ev.data;
                        mw.print("d.user: " + d.user);
                        mw.print("d.method: " + d.method);
                        mw.print("d.quiet: " + d.quiet);
    
                        mw.print("d.channel: " + d.channel);
                        mw.print("d.agent: " + d.agent);
                        mw.print("d.message: " + d.message);
                        break;
                }
        }
        mw.onevent.push(handler);
    
    See src/server/PROTOCOL and src/onoff.h for hints on what those fields
    are.
    ccde2b85
onoff.h 646 Bytes