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) { form.on("submit", function(e) {
e.preventDefault(); e.preventDefault();
var text = input.val(); var text = input.val();
if (text.length === 0) {
return;
}
input.val(""); input.val("");
if (text.indexOf("/clear") === 0) { if (text.indexOf("/clear") === 0) {
clear(); clear();
return; return;
} }
socket.emit("input", { socket.emit("input", {
target: chat.data("id"), target: chat.data("id"),
text: text text: text

View File

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