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

Merge pull request #341 from vanitasvitae/prekeyid

OMEMO: Allow prekey ID 0
This commit is contained in:
Florian Schmaus 2019-08-24 13:12:21 +02:00 committed by GitHub
commit 944dd71976
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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.");