Skip to content
Commit ccde2b85 authored by Andrew Price's avatar Andrew Price
Browse files

Add mw_logon, mw_logoff, talker_join and talker_leave mwjs events

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.
parent c4b787b5
Loading
Loading
Loading
Pipeline #459 passed with stage
in 7 minutes and 50 seconds
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment