mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Added sendStoryMessage
This commit is contained in:
parent
fab1b96c21
commit
811dc0dcf3
5 changed files with 601 additions and 607 deletions
|
@ -189,6 +189,10 @@ public interface Manager extends Closeable {
|
|||
Message message, Set<RecipientIdentifier> recipients, boolean notifySelf
|
||||
) throws IOException, AttachmentInvalidException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException, UnregisteredRecipientException, InvalidStickerException;
|
||||
|
||||
SendMessageResults sendStoryMessage(
|
||||
Message message, Set<RecipientIdentifier> recipients, boolean notifySelf
|
||||
) throws IOException, AttachmentInvalidException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException, UnregisteredRecipientException, InvalidStickerException;
|
||||
|
||||
SendMessageResults sendEditMessage(
|
||||
Message message, Set<RecipientIdentifier> recipients, long editTargetTimestamp
|
||||
) throws IOException, AttachmentInvalidException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException, UnregisteredRecipientException, InvalidStickerException;
|
||||
|
|
|
@ -96,6 +96,7 @@ import org.slf4j.LoggerFactory;
|
|||
import org.whispersystems.signalservice.api.SignalSessionLock;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachment;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage.StoryContext;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServicePreview;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceReceiptMessage;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceTypingMessage;
|
||||
|
@ -736,6 +737,21 @@ public class ManagerImpl implements Manager {
|
|||
return sendMessage(messageBuilder, recipients, notifySelf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SendMessageResults sendStoryMessage(
|
||||
Message message, Set<RecipientIdentifier> recipients, boolean notifySelf
|
||||
) 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 with the updateProfile command. This may become mandatory in the future.");
|
||||
}
|
||||
final var messageBuilder = SignalServiceDataMessage.newBuilder();
|
||||
applyMessage(messageBuilder, message);
|
||||
messageBuilder.withStoryContext(new StoryContext(account.getSelfAddress().getServiceId(), System.currentTimeMillis()));
|
||||
return sendMessage(messageBuilder, recipients, notifySelf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SendMessageResults sendEditMessage(
|
||||
Message message, Set<RecipientIdentifier> recipients, long editTargetTimestamp
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue