From 656282459ccb895b59fcc59e542740ffdf44458a Mon Sep 17 00:00:00 2001 From: AsamK Date: Sat, 14 May 2022 15:43:25 +0200 Subject: [PATCH] Add warning if user has no profile name set --- lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java b/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java index c7f1d22f..63a26b2b 100644 --- a/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java +++ b/lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java @@ -517,6 +517,11 @@ class ManagerImpl implements Manager { public SendMessageResults sendMessage( Message message, Set 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);