Don't send completely empty messages

This commit is contained in:
Maxime Poulin 2016-05-25 03:23:03 -04:00
parent 7834d12e8f
commit 21eafef32d
No known key found for this signature in database
GPG Key ID: CB63C36252F40D4B
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")) {