Refactor Manager interface

This commit is contained in:
AsamK 2021-09-18 10:19:56 +02:00
parent b91c162159
commit d72b838560
33 changed files with 416 additions and 169 deletions

View file

@ -57,14 +57,14 @@ public class JoinGroupCommand implements JsonRpcLocalCommand {
var newGroupId = results.first();
if (outputWriter instanceof JsonWriter) {
final var writer = (JsonWriter) outputWriter;
if (!m.getGroup(newGroupId).isMember(m.getSelfRecipientId())) {
if (!m.getGroup(newGroupId).isMember()) {
writer.write(Map.of("groupId", newGroupId.toBase64(), "onlyRequested", true));
} else {
writer.write(Map.of("groupId", newGroupId.toBase64()));
}
} else {
final var writer = (PlainTextWriter) outputWriter;
if (!m.getGroup(newGroupId).isMember(m.getSelfRecipientId())) {
if (!m.getGroup(newGroupId).isMember()) {
writer.println("Requested to join group \"{}\"", newGroupId.toBase64());
} else {
writer.println("Joined group \"{}\"", newGroupId.toBase64());