public class UpdateGroupCommand implements DbusCommand, JsonRpcLocalCommand {
private final static Logger logger = LoggerFactory.getLogger(UpdateGroupCommand.class);
public class UpdateGroupCommand implements DbusCommand, JsonRpcLocalCommand {
private final static Logger logger = LoggerFactory.getLogger(UpdateGroupCommand.class);
subparser.help("Create or update a group.");
subparser.addArgument("-g", "--group-id", "--group").help("Specify the group ID.");
subparser.addArgument("-n", "--name").help("Specify the new group name.");
subparser.help("Create or update a group.");
subparser.addArgument("-g", "--group-id", "--group").help("Specify the group ID.");
subparser.addArgument("-n", "--name").help("Specify the new group name.");
subparser.addArgument("--set-permission-edit-details")
.help("Set permission to edit group details")
.choices("every-member", "only-admins");
subparser.addArgument("--set-permission-edit-details")
.help("Set permission to edit group details")
.choices("every-member", "only-admins");
- public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
+ public void handleCommand(
+ final Namespace ns, final Manager m, final OutputWriter outputWriter
+ ) throws CommandException {
var groupExpiration = ns.getInt("expiration");
var groupAddMemberPermission = getGroupPermission(ns.getString("set-permission-add-member"));
var groupEditDetailsPermission = getGroupPermission(ns.getString("set-permission-edit-details"));
var groupExpiration = ns.getInt("expiration");
var groupAddMemberPermission = getGroupPermission(ns.getString("set-permission-add-member"));
var groupEditDetailsPermission = getGroupPermission(ns.getString("set-permission-edit-details"));
groupAddMemberPermission,
groupEditDetailsPermission,
groupAvatar == null ? null : new File(groupAvatar),
groupAddMemberPermission,
groupEditDetailsPermission,
groupAvatar == null ? null : new File(groupAvatar),
} catch (AttachmentInvalidException e) {
throw new UserErrorException("Failed to add avatar attachment for group\": " + e.getMessage());
} catch (GroupNotFoundException e) {
} catch (AttachmentInvalidException e) {
throw new UserErrorException("Failed to add avatar attachment for group\": " + e.getMessage());
} catch (GroupNotFoundException e) {
- public void handleCommand(final Namespace ns, final Signal signal) throws CommandException {
+ public void handleCommand(
+ final Namespace ns, final Signal signal, final OutputWriter outputWriter
+ ) throws CommandException {
try {
var newGroupId = signal.updateGroup(groupId, groupName, groupMembers, groupAvatar);
if (groupId.length != newGroupId.length) {
try {
var newGroupId = signal.updateGroup(groupId, groupName, groupMembers, groupAvatar);
if (groupId.length != newGroupId.length) {
}
} catch (Signal.Error.AttachmentInvalid e) {
throw new UserErrorException("Failed to add avatar attachment for group\": " + e.getMessage());
}
} catch (Signal.Error.AttachmentInvalid e) {
throw new UserErrorException("Failed to add avatar attachment for group\": " + e.getMessage());