var netsel = $('#kiwi .formconnectwindow .network'),
netport = $('#kiwi .formconnectwindow .port'),
netssl = $('#kiwi .formconnectwindow .ssl'),
+ netpass = $('#kiwi .formconnectwindow .password'),
nick = $('#kiwi .formconnectwindow .nick'),
tmp;
kiwi.front.ui.doLayout();
try {
- kiwi.front.run('/connect ' + netsel.val() + ' ' + netport.val() + ' ' + (netssl.attr('checked') ? 'true' : ''));
+ kiwi.front.run('/connect ' + netsel.val() + ' ' + netport.val() + ' ' + (netssl.attr('checked') ? 'true' : 'false') + ' ' + netpass.val());
} catch (e) {
console.log(e);
}
case '/connect':
case '/server':
if (typeof parts[1] === 'undefined') {
- alert('Usage: /connect servername [port] [ssl]');
+ alert('Usage: /connect servername [port] [ssl] [password]');
break;
}
}
Tabview.getCurrentTab().addMsg(null, ' ', '=== Connecting to ' + parts[1] + ' on port ' + parts[2] + (parts[3] ? ' using SSL' : '') + '...', 'status');
- kiwi.gateway.connect(parts[1], parts[2], parts[3]);
+ kiwi.gateway.connect(parts[1], parts[2], parts[3], parts[4]);
break;
case '/nick':
}
},
- connect: function (host, port, ssl, callback) {
+ connect: function (host, port, ssl, password, callback) {
if (typeof kiwi.gateway.kiwi_server !== 'undefined') {
kiwi.gateway.socket = io.connect(kiwi_server, {
'try multiple transports': true,
kiwi.gateway.socket.emit('message', {sid: this.session_id, data: $.toJSON(data)}, callback);
};
- kiwi.gateway.socket.emit('irc connect', kiwi.gateway.nick, host, port, ssl, callback);
+ kiwi.gateway.socket.emit('irc connect', kiwi.gateway.nick, host, port, ssl, password, callback);
console.log("kiwi.gateway.socket.on('connect')");
});
kiwi.gateway.socket.on('too_many_connections', function () {
-this.websocketIRCConnect = function (websocket, nick, host, port, ssl, callback) {
+this.websocketIRCConnect = function (websocket, nick, host, port, ssl, password, callback) {
var ircSocket;
//setup IRC connection
if (!ssl) {
if ((kiwi.config.webirc) && (kiwi.config.webirc_pass[host])) {
websocket.sendServerLine('WEBIRC ' + kiwi.config.webirc_pass[host] + ' KiwiIRC ' + websocket.kiwi.hostname + ' ' + websocket.kiwi.address);
}
+ if (password) {
+ websocket.sendServerLine('PASS ' + password);
+ }
websocket.sendServerLine('CAP LS');
websocket.sendServerLine('NICK ' + nick);
websocket.sendServerLine('USER kiwi_' + nick.replace(/[^0-9a-zA-Z\-_.]/, '') + ' 0 0 :' + nick);
a(href="", class="more_link") more
div.content.bottom
ul
- li
- label(for="network") Server:
- input(type="text", id="network", name="network", class="network", value=server)
li
label(for="channel") Channel:
input(type="text", id="channel", name="channel", class="channel", value="#kiwiirc")
+ li
+ label(for="network") Server:
+ input(type="text", id="network", name="network", class="network", value=server)
li(class="section")
label(for="port") Port:
input(type="text", id="port", name="port", class="port", value=port)
+ li
+ label(for="password") Server password:
+ input(type="text", id="password", name="password", class="password")
li
label(for="ssl") SSL:
- if (ssl)