mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Disallow sending an empty message
It would be ignored by the offical apps anyway
This commit is contained in:
parent
4120630309
commit
2c586266ff
1 changed files with 5 additions and 0 deletions
|
@ -170,6 +170,11 @@ public class SendCommand implements JsonRpcLocalCommand {
|
||||||
previews = List.of();
|
previews = List.of();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (messageText.isEmpty() && attachments.isEmpty() && sticker == null && quote == null) {
|
||||||
|
throw new UserErrorException(
|
||||||
|
"Sending empty message is not allowed, either a message, attachment or sticker must be given.");
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var results = m.sendMessage(new Message(messageText,
|
var results = m.sendMessage(new Message(messageText,
|
||||||
attachments,
|
attachments,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue