Avoid blank messages

This commit is contained in:
joker-x 2020-09-16 03:53:07 +02:00 committed by Jonas Herzig
parent 7692a02ab7
commit fd8c7fe4f7

View file

@ -790,6 +790,9 @@ class GlobalBindings {
if (target === this.thisUser()) {
target = target.channel()
}
// Avoid blank message
message = sanitize(message).trim()
if (message.length == 0) return;
// Send message
target.model.sendMessage(message)
if (target.users) { // Channel