org.whispersystems.signalservice.internal.push.SignalServiceProtos.ReceiptMessage Java Examples

The following examples show how to use org.whispersystems.signalservice.internal.push.SignalServiceProtos.ReceiptMessage. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SignalServiceMessageSender.java    From mollyim-android with GNU General Public License v3.0 5 votes vote down vote up
private byte[] createReceiptContent(SignalServiceReceiptMessage message) {
  Content.Builder        container = Content.newBuilder();
  ReceiptMessage.Builder builder   = ReceiptMessage.newBuilder();

  for (long timestamp : message.getTimestamps()) {
    builder.addTimestamp(timestamp);
  }

  if      (message.isDeliveryReceipt()) builder.setType(ReceiptMessage.Type.DELIVERY);
  else if (message.isReadReceipt())     builder.setType(ReceiptMessage.Type.READ);

  return container.setReceiptMessage(builder).build().toByteArray();
}
 
Example #2
Source File: SignalServiceCipher.java    From bcm-android with GNU General Public License v3.0 5 votes vote down vote up
private SignalServiceReceiptMessage createReceiptMessage(SignalServiceProtos.Envelope envelope, ReceiptMessage content) {
  SignalServiceReceiptMessage.Type type;

  if      (content.getType() == ReceiptMessage.Type.DELIVERY) type = SignalServiceReceiptMessage.Type.DELIVERY;
  else if (content.getType() == ReceiptMessage.Type.READ)     type = SignalServiceReceiptMessage.Type.READ;
  else                                                        type = SignalServiceReceiptMessage.Type.UNKNOWN;

  return new SignalServiceReceiptMessage(type, content.getTimestampList(), envelope.getTimestamp());
}
 
Example #3
Source File: SignalServiceMessageSender.java    From libsignal-service-java with GNU General Public License v3.0 5 votes vote down vote up
private byte[] createReceiptContent(SignalServiceReceiptMessage message) {
  Content.Builder        container = Content.newBuilder();
  ReceiptMessage.Builder builder   = ReceiptMessage.newBuilder();

  for (long timestamp : message.getTimestamps()) {
    builder.addTimestamp(timestamp);
  }

  if      (message.isDeliveryReceipt()) builder.setType(ReceiptMessage.Type.DELIVERY);
  else if (message.isReadReceipt())     builder.setType(ReceiptMessage.Type.READ);

  return container.setReceiptMessage(builder).build().toByteArray();
}
 
Example #4
Source File: SignalServiceCipher.java    From libsignal-service-java with GNU General Public License v3.0 5 votes vote down vote up
private SignalServiceReceiptMessage createReceiptMessage(Metadata metadata, ReceiptMessage content) {
  SignalServiceReceiptMessage.Type type;

  if      (content.getType() == ReceiptMessage.Type.DELIVERY) type = SignalServiceReceiptMessage.Type.DELIVERY;
  else if (content.getType() == ReceiptMessage.Type.READ)     type = SignalServiceReceiptMessage.Type.READ;
  else                                                        type = SignalServiceReceiptMessage.Type.UNKNOWN;

  return new SignalServiceReceiptMessage(type, content.getTimestampList(), metadata.getTimestamp());
}