mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-06 22:10:38 +00:00
DbusMention and DbusAttachment, with signals
Two new data types: `DbusMention` (created by @0b11001111) and `DbusAttachment`. Two new signals, `MessageReceivedV2` and `SyncMessageReceivedV2`. This is to address #671 #316 #658 and #491, in particular addressing the issues raised by @AsamK in #658. The new signals provide the new data structures to the user program, while the existing signals, `MessageReceived` and `SyncMessageReceived`, continue to provide the old data types (with no information about mentions or attachment metadata). As a result, for each message received, two signals will be emitted: the legacy signal and the V2 signal. Existing (old-style) programs will not see the V2 signal, and so nothing will break. New programs can ignore the legacy signal and process the enhanced data.
This commit is contained in:
parent
6c29d90503
commit
205cc8d6c2
8 changed files with 518 additions and 32 deletions
|
@ -90,10 +90,10 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
|
|||
writer.indentedWriter()
|
||||
.println("Id: {}", Base64.getEncoder().encodeToString(messageReceived.getGroupId()));
|
||||
}
|
||||
if (messageReceived.getAttachments().size() > 0) {
|
||||
if (messageReceived.getAttachmentNames().size() > 0) {
|
||||
writer.println("Attachments:");
|
||||
for (var attachment : messageReceived.getAttachments()) {
|
||||
writer.println("- Stored plaintext in: {}", attachment);
|
||||
for (var attachmentName : messageReceived.getAttachmentNames()) {
|
||||
writer.println("- Stored plaintext in: {}", attachmentName);
|
||||
}
|
||||
}
|
||||
writer.println();
|
||||
|
@ -115,10 +115,10 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
|
|||
writer.indentedWriter()
|
||||
.println("Id: {}", Base64.getEncoder().encodeToString(syncReceived.getGroupId()));
|
||||
}
|
||||
if (syncReceived.getAttachments().size() > 0) {
|
||||
if (syncReceived.getAttachmentNames().size() > 0) {
|
||||
writer.println("Attachments:");
|
||||
for (var attachment : syncReceived.getAttachments()) {
|
||||
writer.println("- Stored plaintext in: {}", attachment);
|
||||
for (var attachmentName : syncReceived.getAttachmentNames()) {
|
||||
writer.println("- Stored plaintext in: {}", attachmentName);
|
||||
}
|
||||
}
|
||||
writer.println();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue