]> nmode's Git Repositories - signal-cli/commitdiff
Don't abort on empty recipient unless there was also no group specified. (#176)
authorHerohtar <belac1186@gmail.com>
Fri, 14 Dec 2018 17:15:12 +0000 (11:15 -0600)
committerAsamK <asamk@gmx.de>
Fri, 14 Dec 2018 17:15:12 +0000 (18:15 +0100)
* Don't abort on empty recipient unless there was also no group specified.

* Fixed potential error if user tries to send `endsession` to a group

* Display error if trying to send `endsession` to a group

* No need for this check since we're handling that condition above

src/main/java/org/asamk/signal/commands/SendCommand.java

index 308e564cbd453306b236b0062f63e7018bde8bb1..176c2d92f94963db21f3bda9ced0c515ebb3f289 100644 (file)
@@ -46,7 +46,7 @@ public class SendCommand implements DbusCommand {
             return 1;
         }
 
-        if (ns.getList("recipient") == null || ns.getList("recipient").size() == 0) {
+        if ((ns.getList("recipient") == null || ns.getList("recipient").size() == 0) && (ns.getBoolean("endsession") || ns.getString("group") == null)) {
             System.err.println("No recipients given");
             System.err.println("Aborting sending.");
             return 1;