mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-09-01 06:28:11 +00:00
Remove explicit success responses from hangup and reject commands
Successful commands with no additional information should not return a response, matching the pattern used by other signal-cli commands like SendSyncRequestCommand and UpdateConfigurationCommand. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2df034c01b
commit
ad8d692a13
@ -7,9 +7,7 @@ import org.asamk.signal.commands.exceptions.CommandException;
|
||||
import org.asamk.signal.commands.exceptions.IOErrorException;
|
||||
import org.asamk.signal.commands.exceptions.UserErrorException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.output.JsonWriter;
|
||||
import org.asamk.signal.output.OutputWriter;
|
||||
import org.asamk.signal.output.PlainTextWriter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@ -43,14 +41,8 @@ public class HangupCallCommand implements JsonRpcLocalCommand {
|
||||
|
||||
try {
|
||||
m.hangupCall(callId);
|
||||
switch (outputWriter) {
|
||||
case PlainTextWriter writer -> writer.println("Call {} hung up.", callId);
|
||||
case JsonWriter writer -> writer.write(new JsonResult(callId, "hung_up"));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new IOErrorException("Failed to hang up call: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private record JsonResult(long callId, String status) {}
|
||||
}
|
||||
|
||||
@ -7,9 +7,7 @@ import org.asamk.signal.commands.exceptions.CommandException;
|
||||
import org.asamk.signal.commands.exceptions.IOErrorException;
|
||||
import org.asamk.signal.commands.exceptions.UserErrorException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.output.JsonWriter;
|
||||
import org.asamk.signal.output.OutputWriter;
|
||||
import org.asamk.signal.output.PlainTextWriter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@ -43,14 +41,8 @@ public class RejectCallCommand implements JsonRpcLocalCommand {
|
||||
|
||||
try {
|
||||
m.rejectCall(callId);
|
||||
switch (outputWriter) {
|
||||
case PlainTextWriter writer -> writer.println("Call {} rejected.", callId);
|
||||
case JsonWriter writer -> writer.write(new JsonResult(callId, "rejected"));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new IOErrorException("Failed to reject call: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private record JsonResult(long callId, String status) {}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user