Merge pull request #345 from maxpoulin64/no-blank

Don't send completely empty messages
This commit is contained in:
Alistair McKinlay 2016-05-25 08:51:00 +01:00
commit 11465577c0
2 changed files with 12 additions and 0 deletions

View File

@ -604,11 +604,18 @@ $(function() {
form.on("submit", function(e) {
e.preventDefault();
var text = input.val();
if (text.length === 0) {
return;
}
input.val("");
if (text.indexOf("/clear") === 0) {
clear();
return;
}
socket.emit("input", {
target: chat.data("id"),
text: text

View File

@ -9,6 +9,11 @@ exports.input = function(network, chan, cmd, args) {
}
var msg = args.join(" ");
if (msg.length === 0) {
return true;
}
irc.say(target, msg);
if (!network.irc.network.cap.isEnabled("echo-message")) {