mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-19 07:04:21 +01:00
Extend updateProfile command to set family name
This commit is contained in:
@@ -16,7 +16,8 @@ public class UpdateProfileCommand implements LocalCommand {
|
||||
|
||||
@Override
|
||||
public void attachToSubparser(final Subparser subparser) {
|
||||
subparser.addArgument("--name").help("New profile name");
|
||||
subparser.addArgument("--given-name", "--name").help("New profile (given) name");
|
||||
subparser.addArgument("--family-name").help("New profile family name (optional)");
|
||||
subparser.addArgument("--about").help("New profile about text");
|
||||
subparser.addArgument("--about-emoji").help("New profile about emoji");
|
||||
|
||||
@@ -29,7 +30,8 @@ public class UpdateProfileCommand implements LocalCommand {
|
||||
|
||||
@Override
|
||||
public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
|
||||
var name = ns.getString("name");
|
||||
var givenName = ns.getString("given_name");
|
||||
var familyName = ns.getString("family_name");
|
||||
var about = ns.getString("about");
|
||||
var aboutEmoji = ns.getString("about_emoji");
|
||||
var avatarPath = ns.getString("avatar");
|
||||
@@ -40,7 +42,7 @@ public class UpdateProfileCommand implements LocalCommand {
|
||||
: avatarPath == null ? null : Optional.of(new File(avatarPath));
|
||||
|
||||
try {
|
||||
m.setProfile(name, about, aboutEmoji, avatarFile);
|
||||
m.setProfile(givenName, familyName, about, aboutEmoji, avatarFile);
|
||||
} catch (IOException e) {
|
||||
throw new IOErrorException("Update profile error: " + e.getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user