Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add erase option to deactivateAccount #649

Merged
merged 9 commits into from
May 24, 2018
Merged

Conversation

lukebarnard1
Copy link
Contributor

For erasing messages etc. after deactivation.

For erasing messages etc. after deactivation.
src/base-apis.js Outdated
body = {
auth: auth,
};
MatrixBaseApis.prototype.deactivateAccount = function(auth, erase, callback) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should never need three parameters? if you want to pass erase, you should use promises instead of callbacks

src/base-apis.js Outdated
auth: auth,
};
MatrixBaseApis.prototype.deactivateAccount = function(auth, erase, callback) {
if (typeof(erase) === 'function') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elsewhere we have a comment along the lines of "erase used to be callback" or words to that effect

src/base-apis.js Outdated
callback = erase;
erase = undefined;
}
if (typeof(auth) === 'function') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would auth be a function?

src/base-apis.js Outdated
}

const body = {};
if (typeof(auth) === 'object') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what was wrong with if (auth) ?

src/base-apis.js Outdated
);
}

const body = { auth, erase };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auth shouldn't be here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, neither should erase... gah my brain is melting over simple changes

src/base-apis.js Outdated
return this._http.authedRequestWithPrefix(
callback, "POST", '/account/deactivate', undefined, body, httpApi.PREFIX_UNSTABLE,
undefined, "POST", '/account/deactivate', undefined, body,
httpApi.PREFIX_UNSTABLE,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you fix this while you are here please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix what?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PREFIX_UNSTABLE

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@lukebarnard1 lukebarnard1 May 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved it to R0, which I think is correct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well you could just use authedRequest and let it use the default prefix (which is indeed R0) but this is better at least

@richvdh richvdh assigned lukebarnard1 and unassigned richvdh May 23, 2018
@lukebarnard1 lukebarnard1 assigned richvdh and unassigned lukebarnard1 May 24, 2018
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@richvdh richvdh assigned lukebarnard1 and unassigned richvdh May 24, 2018
@lukebarnard1 lukebarnard1 merged commit a50dd78 into develop May 24, 2018
@t3chguy t3chguy deleted the luke/erase-on-deactivate branch May 10, 2022 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants