Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/plugin/action/join.sjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ module.exports = function (client, rawf, emitter) {
reject(new Error("No channel given to join action."));
return;
}

var password;
if (typeof(channel) === "object") {
password = channel.password;
channel = channel.channel;
}
const joinInfo = {
names: [],
channel: channel,
Expand Down Expand Up @@ -104,10 +108,14 @@ module.exports = function (client, rawf, emitter) {
};

client.debug("PluginAction", formatc("Attempting to join %s."));
Copy link
Member

@Havvy Havvy Aug 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will print "[Object object]" if type is object. As such, this debug needs to be inside the else case, and a different debug needs to be inside the passworded version.

Note: This is addressed by normalizing the input into two variables at the top of the function.

rawf("JOIN :%s", channel);
if (password !== undefined) {
rawf("JOIN %s :%s", channel, password);
} else {
rawf("JOIN :%s", channel);
}
})
.tap(function (result) {
emitter.emit("join", result);
});
};
};
};