]> nmode's Git Repositories - signal-cli/commitdiff
Merge branch 'master' into dbus_sendviewed 764/head
authorAsamK <asamk@gmx.de>
Sat, 30 Oct 2021 10:46:59 +0000 (12:46 +0200)
committerGitHub <noreply@github.com>
Sat, 30 Oct 2021 10:46:59 +0000 (12:46 +0200)
1  2 
man/signal-cli-dbus.5.adoc
src/main/java/org/asamk/Signal.java
src/main/java/org/asamk/signal/dbus/DbusSignalImpl.java
src/main/java/org/asamk/signal/json/JsonReceiptMessage.java

index 093f5807a70316493726a36839dadaa2338cbaac,4c317db3dfc40dc3d7bd04982e2ec40d7536111d..1bc0b879fd201928c646d684b6d3bd8b03895488
@@@ -248,13 -449,19 +449,25 @@@ Depending on the type of the recipient(
  
  Exceptions: Failure, InvalidNumber
  
- sendGroupRemoteDeleteMessage(targetSentTimestamp<x>, groupId<ay>) -> timestamp<x>::
- * targetSentTimestamp : Long representing timestamp of the message to delete
- * groupId             : Byte array with base64 encoded group identifier
- * timestamp           : Long, can be used to identify the corresponding signal reply
+ sendNoteToSelfMessage(message<s>, attachments<as>) -> timestamp<x>::
+ * message     : Text to send (can be UTF8)
+ * attachments : String array of filenames to send as attachments (passed as filename, so need to be readable by the user signal-cli is running under)
+ * timestamp   : Long, can be used to identify the corresponding Signal reply
+ Exceptions: Failure, AttachmentInvalid
  
- Exceptions: Failure, GroupNotFound
+ sendReadReceipt(recipient<s>, targetSentTimestamps<ax>) -> <>::
+ * recipient             : Phone number of a single recipient
+ * targetSentTimestamps  : Array of Longs to identify the corresponding Signal messages
+ Exceptions: Failure, UntrustedIdentity
++sendViewedReceipt(recipient<s>, targetSentTimestamp<ax>) -> <>::
++* recipient             : Phone number of a single recipient
++* targetSentTimestamp   : Array of Longs to identify the corresponding signal messages
++
++Exceptions: Failure, UntrustedIdentity
 +
  sendRemoteDeleteMessage(targetSentTimestamp<x>, recipient<s>) -> timestamp<x>::
  sendRemoteDeleteMessage(targetSentTimestamp<x>, recipients<as>) -> timestamp<x>::
  * targetSentTimestamp : Long representing timestamp of the message to delete
Simple merge
index 15e2cf434f6a41f0b44d9c2d7eaf0facc81b5808,af7050b1c7c729fdce7753ea83149b111d2245d3..1199c790270054aa08293ded2c116e825820f942
@@@ -6,42 -4,17 +4,18 @@@ import org.whispersystems.signalservice
  
  import java.util.List;
  
- class JsonReceiptMessage {
-     @JsonProperty
-     final long when;
-     @JsonProperty
-     final boolean isDelivery;
-     @JsonProperty
-     final boolean isRead;
-     @JsonProperty
-     final boolean isViewed;
-     @JsonProperty
-     final List<Long> timestamps;
-     JsonReceiptMessage(SignalServiceReceiptMessage receiptMessage) {
-         this.when = receiptMessage.getWhen();
-         this.isDelivery = receiptMessage.isDeliveryReceipt();
-         this.isRead = receiptMessage.isReadReceipt();
-         this.isViewed = receiptMessage.isViewedReceipt();
-         this.timestamps = receiptMessage.getTimestamps();
-     }
 -record JsonReceiptMessage(long when, boolean isDelivery, boolean isRead, List<Long> timestamps) {
++record JsonReceiptMessage(long when, boolean isDelivery, boolean isRead, boolean isViewed, List<Long> timestamps) {
  
-     private JsonReceiptMessage(
-             final long when, final boolean isDelivery, final boolean isRead, final boolean isViewed, final List<Long> timestamps
-     ) {
-         this.when = when;
-         this.isDelivery = isDelivery;
-         this.isRead = isRead;
-         this.isViewed = isViewed;
-         this.timestamps = timestamps;
+     static JsonReceiptMessage from(SignalServiceReceiptMessage receiptMessage) {
+         final var when = receiptMessage.getWhen();
+         final var isDelivery = receiptMessage.isDeliveryReceipt();
+         final var isRead = receiptMessage.isReadReceipt();
++        final var isViewed = receiptMessage.isViewedReceipt();
+         final var timestamps = receiptMessage.getTimestamps();
 -        return new JsonReceiptMessage(when, isDelivery, isRead, timestamps);
++        return new JsonReceiptMessage(when, isDelivery, isRead, isViewed, timestamps);
      }
  
      static JsonReceiptMessage deliveryReceipt(final long when, final List<Long> timestamps) {
-         return new JsonReceiptMessage(when, true, false, false, timestamps);
 -        return new JsonReceiptMessage(when, true, false, timestamps);
++        return new JsonReceiptMessage(when, true, false, false, false, timestamps);
      }
  }