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

org.whispersystems.signalservice.api.groupsv2.GroupLinkNotActiveException Maven / Gradle / Ivy

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


import java.util.Optional;

/**
 * Thrown when a group link:
 * - has an out of date password, or;
 * - is currently not shared, or;
 * - has been banned from the group, or;
 * - the master key does not match a group on the server
 */
public final class GroupLinkNotActiveException extends Exception {

  private final Reason reason;

  public GroupLinkNotActiveException(Throwable t, Optional reason) {
    super(t);

    if (reason.isPresent() && reason.get().equalsIgnoreCase("banned")) {
      this.reason = Reason.BANNED;
    } else {
      this.reason = Reason.UNKNOWN;
    }
  }

  public Reason getReason() {
    return reason;
  }

  public enum Reason {
    UNKNOWN,
    BANNED
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy