mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 03:53:08 +00:00
Send all modes in case of no ISUPPORT
This commit is contained in:
parent
23f6886cc1
commit
d96704835a
2 changed files with 5 additions and 3 deletions
|
@ -42,7 +42,7 @@ exports.input = function ({irc, nick}, chan, cmd, args) {
|
|||
devoice: "-v",
|
||||
}[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) {
|
||||
const targets = target.slice(i, i + limit);
|
||||
|
|
|
@ -118,12 +118,14 @@ describe("Commands", function () {
|
|||
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"]);
|
||||
expect(testableNetworkNoSupports.lastCommand).to.equal("MODE #thelounge +v xPaw");
|
||||
|
||||
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 a new issue