]> nmode's Git Repositories - signal-cli/commitdiff
Add warning if user has no profile name set
authorAsamK <asamk@gmx.de>
Sat, 14 May 2022 13:43:25 +0000 (15:43 +0200)
committerAsamK <asamk@gmx.de>
Sat, 14 May 2022 13:51:23 +0000 (15:51 +0200)
lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java

index c7f1d22fa57fd70134beb6f5611da9d15def1500..63a26b2b04371d9b0a64d03729c6f54d37136f2e 100644 (file)
@@ -517,6 +517,11 @@ class ManagerImpl implements Manager {
     public SendMessageResults sendMessage(
             Message message, Set<RecipientIdentifier> recipients
     ) throws IOException, AttachmentInvalidException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException, UnregisteredRecipientException, InvalidStickerException {
+        final var selfProfile = context.getProfileHelper().getSelfProfile();
+        if (selfProfile == null || selfProfile.getDisplayName().isEmpty()) {
+            logger.warn(
+                    "No profile name set. When sending a message it's recommended to set a profile name wit the updateProfile command. This may become mandatory in the future.");
+        }
         final var messageBuilder = SignalServiceDataMessage.newBuilder();
         applyMessage(messageBuilder, message);
         return sendMessage(messageBuilder, recipients);