Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Add support for fetchesMessages #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -122,11 +122,11 @@ public void requestVoiceVerificationCode() throws IOException {
* @throws IOException
*/
public void verifyAccount(String verificationCode, String signalingKey,
boolean supportsSms, int axolotlRegistrationId)
boolean supportsSms, boolean fetchesMessages, int axolotlRegistrationId)
throws IOException
{
this.pushServiceSocket.verifyAccount(verificationCode, signalingKey,
supportsSms, axolotlRegistrationId);
supportsSms, fetchesMessages, axolotlRegistrationId);
}

/**
Expand Down
Expand Up @@ -26,13 +26,18 @@ public class AccountAttributes {
@JsonProperty
private boolean supportsSms;

@JsonProperty
private boolean fetchesMessages;


@JsonProperty
private int registrationId;

public AccountAttributes(String signalingKey, boolean supportsSms, int registrationId) {
this.signalingKey = signalingKey;
this.supportsSms = supportsSms;
this.registrationId = registrationId;
public AccountAttributes(String signalingKey, boolean supportsSms, boolean fetchesMessages, int registrationId) {
this.signalingKey = signalingKey;
this.supportsSms = supportsSms;
this.fetchesMessages = fetchesMessages;
this.registrationId = registrationId;
}

public AccountAttributes() {}
Expand All @@ -48,4 +53,6 @@ public boolean isSupportsSms() {
public int getRegistrationId() {
return registrationId;
}

public boolean isFetchesMessages() { return fetchesMessages; }
}
Expand Up @@ -112,10 +112,10 @@ public void createAccount(boolean voice) throws IOException {
}

public void verifyAccount(String verificationCode, String signalingKey,
boolean supportsSms, int registrationId)
boolean supportsSms, boolean fetchesMessages, int registrationId)
throws IOException
{
AccountAttributes signalingKeyEntity = new AccountAttributes(signalingKey, supportsSms, registrationId);
AccountAttributes signalingKeyEntity = new AccountAttributes(signalingKey, supportsSms, fetchesMessages, registrationId);
makeRequest(String.format(VERIFY_ACCOUNT_PATH, verificationCode),
"PUT", JsonUtil.toJson(signalingKeyEntity));
}
Expand Down