]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/helper/ProfileHelper.java
Extract getSelfProfile method
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / helper / ProfileHelper.java
index 53a48466e1120b477fcb59bc7ce73188a004e0b3..7afa63fcd4aa2c26f6befd93fb127128b9276be5 100644 (file)
@@ -114,7 +114,7 @@ public final class ProfileHelper {
             String aboutEmoji,
             Optional<File> avatar
     ) throws IOException {
-        var profile = getRecipientProfile(account.getSelfRecipientId());
+        var profile = getSelfProfile();
         var builder = profile == null ? Profile.newBuilder() : Profile.newBuilder(profile);
         if (givenName != null) {
             builder.withGivenName(givenName);
@@ -164,6 +164,10 @@ public final class ProfileHelper {
         account.getProfileStore().storeProfile(account.getSelfRecipientId(), newProfile);
     }
 
+    public Profile getSelfProfile() {
+        return getRecipientProfile(account.getSelfRecipientId());
+    }
+
     public List<Profile> getRecipientProfile(List<RecipientId> recipientIds) {
         try {
             account.getRecipientStore().setBulkUpdating(true);