Opened 12 years ago

#1123 new Defect

Javascript Plugin error

Reported by: loudambiance Owned by:
Component: Colloquy (Mac) Version: 2.1 (Mac)
Severity: Normal Keywords: javascript plugin
Cc:

Description

The example js plugn code:

function processIncomingMessage(message, view) {
        var bugRegex = new RegExp( '\\bbugs?\\b', 'gmi' );
        if( bugRegex.exec(message.bodyAsPlainText()) && ! message.senderIsLocalUser() ) {
                var msg = new JVMutableChatMessage('', view.connection.localUser());
                msg.setBodyAsHTML(message.senderNickname() + ': <u>please</u> report any Colloquy bugs at http://colloquy.info?bugs');
                view.sendMessage(msg);
                view.echoSentMessageToDisplay(msg);
        }
}

Causes this error to appear:
Value undefined (result of expression view.connection.localUser) is not object.
Line number: 4

Change History (0)

Note: See TracTickets for help on using tickets.