All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.whispersystems.signalservice.internal.push.SendGroupMessageResponse Maven / Gradle / Ivy

There is a newer version: 2.15.3_unofficial_107
Show newest version
package org.whispersystems.signalservice.internal.push;

import com.fasterxml.jackson.annotation.JsonProperty;

import org.signal.libsignal.protocol.logging.Log;
import org.whispersystems.signalservice.api.push.ServiceId;

import java.util.HashSet;
import java.util.Set;

public class SendGroupMessageResponse {

  private static final String TAG = SendGroupMessageResponse.class.getSimpleName();

  // Contains serialized ServiceIds
  @JsonProperty
  private String[] uuids404;

  public SendGroupMessageResponse() {}

  public Set getUnsentTargets() {
    String[]       uuids      = uuids404 != null ? uuids404 : new String[0];
    Set serviceIds = new HashSet<>(uuids.length);

    for (String raw : uuids) {
      ServiceId parsed = ServiceId.parseOrNull(raw);
      if (parsed != null) {
        serviceIds.add(parsed);
      } else {
        Log.w(TAG, "Failed to parse ServiceId!");
      }
    }

    return serviceIds;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy