Allow /connect command to work on current network
This commit is contained in:
parent
047a79ead6
commit
a0010ca9f6
@ -1,8 +1,24 @@
|
|||||||
|
var Msg = require("../../models/msg");
|
||||||
|
|
||||||
exports.commands = ["connect", "server"];
|
exports.commands = ["connect", "server"];
|
||||||
exports.allowDisconnected = true;
|
exports.allowDisconnected = true;
|
||||||
|
|
||||||
exports.input = function(network, chan, cmd, args) {
|
exports.input = function(network, chan, cmd, args) {
|
||||||
if (args.length === 0) {
|
if (args.length === 0) {
|
||||||
|
if (!network.irc || !network.irc.connection) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (network.irc.connection.connected) {
|
||||||
|
chan.pushMessage(this, new Msg({
|
||||||
|
type: Msg.Type.ERROR,
|
||||||
|
text: "You are already connected."
|
||||||
|
}));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
network.irc.connection.connect();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user