Show view once, remote delete and mentions info when receiving message

This commit is contained in:
AsamK 2020-11-21 11:50:40 +01:00
parent b0502f9f82
commit 019efbe22c

View file

@ -259,6 +259,9 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
private void handleSignalServiceDataMessage(SignalServiceDataMessage message) {
System.out.println("Message timestamp: " + DateUtils.formatTimestamp(message.getTimestamp()));
if (message.isViewOnce()) {
System.out.println("=VIEW ONCE=");
}
if (message.getBody().isPresent()) {
System.out.println("Body: " + message.getBody().get());
@ -355,6 +358,18 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
}
}
if (message.getRemoteDelete().isPresent()) {
final SignalServiceDataMessage.RemoteDelete remoteDelete = message.getRemoteDelete().get();
System.out.println("Remote delete message: timestamp = " + remoteDelete.getTargetSentTimestamp());
}
if (message.getMentions().isPresent()) {
final List<SignalServiceDataMessage.Mention> mentions = message.getMentions().get();
System.out.println("Mentions: ");
for (SignalServiceDataMessage.Mention mention : mentions) {
System.out.println("- " + mention.getUuid() + ": " + mention.getStart() + " (length: " + mention.getLength() + ")");
}
}
if (message.getAttachments().isPresent()) {
System.out.println("Attachments: ");
for (SignalServiceAttachment attachment : message.getAttachments().get()) {