mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Show view once, remote delete and mentions info when receiving message
This commit is contained in:
parent
b0502f9f82
commit
019efbe22c
1 changed files with 15 additions and 0 deletions
|
@ -259,6 +259,9 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
|
||||||
|
|
||||||
private void handleSignalServiceDataMessage(SignalServiceDataMessage message) {
|
private void handleSignalServiceDataMessage(SignalServiceDataMessage message) {
|
||||||
System.out.println("Message timestamp: " + DateUtils.formatTimestamp(message.getTimestamp()));
|
System.out.println("Message timestamp: " + DateUtils.formatTimestamp(message.getTimestamp()));
|
||||||
|
if (message.isViewOnce()) {
|
||||||
|
System.out.println("=VIEW ONCE=");
|
||||||
|
}
|
||||||
|
|
||||||
if (message.getBody().isPresent()) {
|
if (message.getBody().isPresent()) {
|
||||||
System.out.println("Body: " + message.getBody().get());
|
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()) {
|
if (message.getAttachments().isPresent()) {
|
||||||
System.out.println("Attachments: ");
|
System.out.println("Attachments: ");
|
||||||
for (SignalServiceAttachment attachment : message.getAttachments().get()) {
|
for (SignalServiceAttachment attachment : message.getAttachments().get()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue