mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Add a new sync dbus message which shows messages you sent. Necessary for having synchronized chats where you want your message to appear. Format is similar to receive message dbus except instead of sender, it has sender (source) and receiver (destination). (#289)
This commit is contained in:
parent
e684a902bb
commit
d49d536c32
3 changed files with 114 additions and 22 deletions
|
@ -53,7 +53,22 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
|
|||
});
|
||||
dbusconnection.addSigHandler(Signal.ReceiptReceived.class,
|
||||
receiptReceived -> System.out.print(String.format("Receipt from: %s\nTimestamp: %s\n",
|
||||
receiptReceived.getSender(), DateUtils.formatTimestamp(receiptReceived.getTimestamp()))));
|
||||
receiptReceived.getSender(), DateUtils.formatTimestamp(receiptReceived.getTimestamp()))));
|
||||
dbusconnection.addSigHandler(Signal.SyncMessageReceived.class, syncReceived -> {
|
||||
System.out.print(String.format("Sync Envelope from: %s to: %s\nTimestamp: %s\nBody: %s\n",
|
||||
syncReceived.getSource(), syncReceived.getDestination(), DateUtils.formatTimestamp(syncReceived.getTimestamp()), syncReceived.getMessage()));
|
||||
if (syncReceived.getGroupId().length > 0) {
|
||||
System.out.println("Group info:");
|
||||
System.out.println(" Id: " + Base64.encodeBytes(syncReceived.getGroupId()));
|
||||
}
|
||||
if (syncReceived.getAttachments().size() > 0) {
|
||||
System.out.println("Attachments: ");
|
||||
for (String attachment : syncReceived.getAttachments()) {
|
||||
System.out.println("- Stored plaintext in: " + attachment);
|
||||
}
|
||||
}
|
||||
System.out.println();
|
||||
});
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
System.err.println("Missing native library dependency for dbus service: " + e.getMessage());
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue