Implement editing of previous messages

This commit is contained in:
AsamK 2023-05-11 19:10:29 +02:00
parent 72390e595d
commit 8a31b7f2c1
13 changed files with 179 additions and 42 deletions

View file

@ -10,6 +10,7 @@ import org.asamk.signal.manager.api.Group;
import org.asamk.signal.manager.api.Identity;
import org.asamk.signal.manager.api.InactiveGroupLinkException;
import org.asamk.signal.manager.api.InvalidDeviceLinkException;
import org.asamk.signal.manager.api.InvalidStickerException;
import org.asamk.signal.manager.api.InvalidUsernameException;
import org.asamk.signal.manager.api.Message;
import org.asamk.signal.manager.api.MessageEnvelope;
@ -25,6 +26,7 @@ import org.asamk.signal.manager.api.StickerPack;
import org.asamk.signal.manager.api.StickerPackInvalidException;
import org.asamk.signal.manager.api.StickerPackUrl;
import org.asamk.signal.manager.api.TypingAction;
import org.asamk.signal.manager.api.UnregisteredRecipientException;
import org.asamk.signal.manager.api.UpdateGroup;
import org.asamk.signal.manager.api.UpdateProfile;
import org.asamk.signal.manager.api.UserStatus;
@ -369,6 +371,13 @@ public class DbusManagerImpl implements Manager {
groupId -> signal.sendGroupMessage(message.messageText(), message.attachments(), groupId));
}
@Override
public SendMessageResults sendEditMessage(
final Message message, final Set<RecipientIdentifier> recipients, final long editTargetTimestamp
) throws IOException, AttachmentInvalidException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException, UnregisteredRecipientException, InvalidStickerException {
throw new UnsupportedOperationException();
}
@Override
public SendMessageResults sendRemoteDeleteMessage(
final long targetSentTimestamp, final Set<RecipientIdentifier> recipients
@ -801,6 +810,7 @@ public class DbusManagerImpl implements Manager {
List.of())),
Optional.empty(),
Optional.empty(),
Optional.empty(),
Optional.empty());
notifyMessageHandlers(envelope);
};
@ -827,6 +837,7 @@ public class DbusManagerImpl implements Manager {
Optional.empty(),
Optional.empty(),
Optional.empty(),
Optional.empty(),
Optional.empty());
notifyMessageHandlers(envelope);
};
@ -844,6 +855,7 @@ public class DbusManagerImpl implements Manager {
Optional.empty(),
Optional.empty(),
Optional.empty(),
Optional.empty(),
Optional.of(new MessageEnvelope.Sync(Optional.of(new MessageEnvelope.Sync.Sent(syncReceived.getTimestamp(),
syncReceived.getTimestamp(),
syncReceived.getDestination().isEmpty()
@ -874,6 +886,7 @@ public class DbusManagerImpl implements Manager {
List.of(),
List.of(),
List.of())),
Optional.empty(),
Optional.empty())),
Optional.empty(),
List.of(),