]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/commands/UpdateProfileCommand.java
Add --scrub-log flag to remove possibly sensitive information from the log
[signal-cli] / src / main / java / org / asamk / signal / commands / UpdateProfileCommand.java
index 1edb6df985ced69758327e8f19042d5b3ac0da65..d8e874302de747bd2f06a85c3f6a688a8a442627 100644 (file)
@@ -12,6 +12,7 @@ import org.asamk.signal.output.OutputWriter;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.Base64;
 
 public class UpdateProfileCommand implements JsonRpcLocalCommand {
 
@@ -27,6 +28,7 @@ public class UpdateProfileCommand implements JsonRpcLocalCommand {
         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");
+        subparser.addArgument("--mobile-coin-address").help("New MobileCoin address (Base64 encoded public address)");
 
         final var avatarOptions = subparser.addMutuallyExclusiveGroup();
         avatarOptions.addArgument("--avatar").help("Path to new profile avatar");
@@ -41,9 +43,13 @@ public class UpdateProfileCommand implements JsonRpcLocalCommand {
         var familyName = ns.getString("family-name");
         var about = ns.getString("about");
         var aboutEmoji = ns.getString("about-emoji");
+        var mobileCoinAddressString = ns.getString("mobile-coin-address");
+        var mobileCoinAddress = mobileCoinAddressString == null
+                ? null
+                : Base64.getDecoder().decode(mobileCoinAddressString);
+
         var avatarPath = ns.getString("avatar");
         boolean removeAvatar = Boolean.TRUE.equals(ns.getBoolean("remove-avatar"));
-
         File avatarFile = removeAvatar || avatarPath == null ? null : new File(avatarPath);
 
         try {
@@ -52,6 +58,7 @@ public class UpdateProfileCommand implements JsonRpcLocalCommand {
                     .withFamilyName(familyName)
                     .withAbout(about)
                     .withAboutEmoji(aboutEmoji)
+                    .withMobileCoinAddress(mobileCoinAddress)
                     .withAvatar(avatarFile)
                     .withDeleteAvatar(removeAvatar)
                     .build());