Skip to content

Commit

Permalink
Merge pull request thelounge#320 from maxpoulin64/fix-space
Browse files Browse the repository at this point in the history
Fix sending messages starting with a space
  • Loading branch information
astorije committed May 21, 2016
2 parents 2372d31 + 39b2af5 commit 5934302
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ Client.prototype.setPassword = function(hash) {

Client.prototype.input = function(data) {
var client = this;
var text = data.text.trim();
var text = data.text;
var target = client.find(data.target);

// This is either a normal message or a command escaped with a leading '/'
Expand Down
16 changes: 4 additions & 12 deletions src/plugins/inputs/msg.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
exports.commands = ["msg", "say"];

exports.input = function(network, chan, cmd, args) {
if (args.length === 0 || args[0] === "") {
return true;
}

var irc = network.irc;
var target = "";
if (cmd === "msg") {
target = args.shift();
if (args.length === 0) {
return true;
}
} else {
target = chan.name;
var target = cmd === "msg" ? args.shift() : chan.name;

if (args.length === 0 || !target) {
return true;
}

var msg = args.join(" ");
Expand Down

0 comments on commit 5934302

Please sign in to comment.