Implement EditMessageReceived signal for dbus

This commit is contained in:
AsamK 2023-10-10 20:21:40 +02:00
parent 7b5b5776f0
commit a66dd0dc79
4 changed files with 124 additions and 1 deletions

View file

@ -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()) {