1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 12:37:58 +01:00

OMEMO: Allow prekey ID 0

This commit is contained in:
Paul Schaub 2019-08-24 12:22:38 +02:00
parent 9de2b983c8
commit a160358d5d
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -60,8 +60,8 @@ public abstract class OmemoBundleElement implements ExtensionElement {
* @param preKeysB64 HashMap of base64 encoded preKeys
*/
public OmemoBundleElement(int signedPreKeyId, String signedPreKeyB64, String signedPreKeySigB64, String identityKeyB64, HashMap<Integer, String> preKeysB64) {
if (signedPreKeyId <= 0) {
throw new IllegalArgumentException("signedPreKeyId MUST be greater than 0.");
if (signedPreKeyId < 0) {
throw new IllegalArgumentException("signedPreKeyId MUST be greater than or equal to 0.");
}
this.signedPreKeyId = signedPreKeyId;
this.signedPreKeyB64 = StringUtils.requireNotNullNorEmpty(signedPreKeyB64, "signedPreKeyB64 MUST NOT be null nor empty.");