Fix sending messages starting with a space
There really is no need to trim apart bringing more situations like this. If I want to put spaces in front of my message (say, for alignment purposes), then I should be able to. Fixes #319
This commit is contained in:
parent
973fa0f4b2
commit
5a3b07a698
@ -267,7 +267,7 @@ Client.prototype.setPassword = function(hash) {
|
|||||||
|
|
||||||
Client.prototype.input = function(data) {
|
Client.prototype.input = function(data) {
|
||||||
var client = this;
|
var client = this;
|
||||||
var text = data.text.trim();
|
var text = data.text;
|
||||||
var target = client.find(data.target);
|
var target = client.find(data.target);
|
||||||
|
|
||||||
// This is either a normal message or a command escaped with a leading '/'
|
// This is either a normal message or a command escaped with a leading '/'
|
||||||
|
@ -1,20 +1,12 @@
|
|||||||
exports.commands = ["msg", "say"];
|
exports.commands = ["msg", "say"];
|
||||||
|
|
||||||
exports.input = function(network, chan, cmd, args) {
|
exports.input = function(network, chan, cmd, args) {
|
||||||
if (args.length === 0 || args[0] === "") {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var irc = network.irc;
|
var irc = network.irc;
|
||||||
var target = "";
|
var target = cmd === "msg" ? args.shift() : chan.name;
|
||||||
if (cmd === "msg") {
|
|
||||||
target = args.shift();
|
if (args.length === 0 || !target) {
|
||||||
if (args.length === 0) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
target = chan.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
var msg = args.join(" ");
|
var msg = args.join(" ");
|
||||||
irc.say(target, msg);
|
irc.say(target, msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user