]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/helper/ProfileHelper.java
Add mobile-coin-address to updateProfile command
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / helper / ProfileHelper.java
index 1a876d7ec4d1826b52bc0ff760f94d2fc5615483..cc01dc73bb822e2903ddc5d4a6c0a5f7798a0a05 100644 (file)
@@ -64,7 +64,7 @@ public final class ProfileHelper {
         var profileKey = KeyUtils.createProfileKey();
         account.setProfileKey(profileKey);
         context.getAccountHelper().updateAccountAttributes();
-        setProfile(true, true, null, null, null, null, null);
+        setProfile(true, true, null, null, null, null, null, null);
         // TODO update profile key in storage
 
         final var recipientIds = account.getRecipientStore().getRecipientIdsWithEnabledProfileSharing();
@@ -144,9 +144,14 @@ public final class ProfileHelper {
      * @param avatar     if avatar is null the image from the local avatar store is used (if present),
      */
     public void setProfile(
-            String givenName, final String familyName, String about, String aboutEmoji, Optional<File> avatar
+            String givenName,
+            final String familyName,
+            String about,
+            String aboutEmoji,
+            Optional<File> avatar,
+            byte[] mobileCoinAddress
     ) throws IOException {
-        setProfile(true, false, givenName, familyName, about, aboutEmoji, avatar);
+        setProfile(true, false, givenName, familyName, about, aboutEmoji, avatar, mobileCoinAddress);
     }
 
     public void setProfile(
@@ -156,7 +161,8 @@ public final class ProfileHelper {
             final String familyName,
             String about,
             String aboutEmoji,
-            Optional<File> avatar
+            Optional<File> avatar,
+            byte[] mobileCoinAddress
     ) throws IOException {
         var profile = getSelfProfile();
         var builder = profile == null ? Profile.newBuilder() : Profile.newBuilder(profile);
@@ -172,6 +178,9 @@ public final class ProfileHelper {
         if (aboutEmoji != null) {
             builder.withAboutEmoji(aboutEmoji);
         }
+        if (mobileCoinAddress != null) {
+            builder.withMobileCoinAddress(mobileCoinAddress);
+        }
         var newProfile = builder.build();
 
         if (uploadProfile) {