]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/helper/ContactHelper.java
Enable profile sharing when accepting message request
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / helper / ContactHelper.java
index 609c2bcf77ee100ceec3ddc4913f76e9b2aa580c..f9af27f18cf964d2edf077e47168125a88a414d8 100644 (file)
@@ -49,6 +49,13 @@ public class ContactHelper {
         account.getContactStore().storeContact(recipientId, builder.withIsBlocked(blocked).build());
     }
 
+    public void setContactProfileSharing(RecipientId recipientId, boolean profileSharing) {
+        var contact = account.getContactStore().getContact(recipientId);
+        final var builder = contact == null ? Contact.newBuilder() : Contact.newBuilder(contact);
+        builder.withIsProfileSharingEnabled(profileSharing);
+        account.getContactStore().storeContact(recipientId, builder.build());
+    }
+
     public void setContactHidden(RecipientId recipientId, boolean hidden) {
         var contact = account.getContactStore().getContact(recipientId);
         final var builder = contact == null ? Contact.newBuilder() : Contact.newBuilder(contact);