X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/e5a67d6ce1312fe118e99b8bc8fb2f55ed1dbcf2..33c4e17c0d295d437438f6e1d8fbfd1ae6640f3c:/src/main/java/org/asamk/signal/dbus/DbusReceiveMessageHandler.java diff --git a/src/main/java/org/asamk/signal/dbus/DbusReceiveMessageHandler.java b/src/main/java/org/asamk/signal/dbus/DbusReceiveMessageHandler.java index 3176620d..6aac76a8 100644 --- a/src/main/java/org/asamk/signal/dbus/DbusReceiveMessageHandler.java +++ b/src/main/java/org/asamk/signal/dbus/DbusReceiveMessageHandler.java @@ -74,6 +74,27 @@ public class DbusReceiveMessageHandler implements Manager.ReceiveMessageHandler getMessageExtras(message))); } } + if (envelope.edit().isPresent()) { + var editMessage = envelope.edit().get(); + var message = editMessage.dataMessage(); + + var groupId = message.groupContext() + .map(MessageEnvelope.Data.GroupContext::groupId) + .map(GroupId::serialize) + .orElseGet(() -> new byte[0]); + var isGroupUpdate = message.groupContext() + .map(MessageEnvelope.Data.GroupContext::isGroupUpdate) + .orElse(false); + if (!message.isEndSession() && !isGroupUpdate) { + conn.sendMessage(new Signal.EditMessageReceived(objectPath, + message.timestamp(), + editMessage.targetSentTimestamp(), + senderString, + groupId, + message.body().orElse(""), + getMessageExtras(message))); + } + } if (envelope.sync().isPresent()) { var syncMessage = envelope.sync().get(); if (syncMessage.sent().isPresent()) {