Send all modes in case of no ISUPPORT
This commit is contained in:
parent
23f6886cc1
commit
d96704835a
@ -42,7 +42,7 @@ exports.input = function ({irc, nick}, chan, cmd, args) {
|
|||||||
devoice: "-v",
|
devoice: "-v",
|
||||||
}[cmd];
|
}[cmd];
|
||||||
|
|
||||||
const limit = parseInt(irc.network.supports("MODES")) || 1;
|
const limit = parseInt(irc.network.supports("MODES")) || target.length;
|
||||||
|
|
||||||
for (let i = 0; i < target.length; i += limit) {
|
for (let i = 0; i < target.length; i += limit) {
|
||||||
const targets = target.slice(i, i + limit);
|
const targets = target.slice(i, i + limit);
|
||||||
|
@ -118,12 +118,14 @@ describe("Commands", function () {
|
|||||||
expect(testableNetwork.lastCommand).to.equal("MODE #thelounge -v thelounge");
|
expect(testableNetwork.lastCommand).to.equal("MODE #thelounge -v thelounge");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should fallback to default limit of 1 mode for shorthand commands", function () {
|
it("should fallback to all modes at once for shorthand commands", function () {
|
||||||
ModeCommand.input(testableNetworkNoSupports, channel, "voice", ["xPaw"]);
|
ModeCommand.input(testableNetworkNoSupports, channel, "voice", ["xPaw"]);
|
||||||
expect(testableNetworkNoSupports.lastCommand).to.equal("MODE #thelounge +v xPaw");
|
expect(testableNetworkNoSupports.lastCommand).to.equal("MODE #thelounge +v xPaw");
|
||||||
|
|
||||||
ModeCommand.input(testableNetworkNoSupports, channel, "devoice", ["xPaw", "Max-P"]);
|
ModeCommand.input(testableNetworkNoSupports, channel, "devoice", ["xPaw", "Max-P"]);
|
||||||
expect(testableNetworkNoSupports.lastCommand).to.equal("MODE #thelounge -v Max-P");
|
expect(testableNetworkNoSupports.lastCommand).to.equal(
|
||||||
|
"MODE #thelounge -vv xPaw Max-P"
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user