-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Some of our account-related methods, namely verifyCredentials() and updateCredentials(), return a CredentialAccount instead of an Account since the last snapshot release.
In our code, these entities are completely separate out of necessity (inheritance and data classes don't mix well), although Mastodon does not make this distinction. While some parts of the documentation specifically mention a "CredentialAccount" entity, others refer to the returned data as "an Account entity, with the source parameter included" (example: https://docs.joinmastodon.org/client/authorized/).
There doesn't seem to be any other way to retrieve the user's own account other than using verifyCredentials(), so I'd argue that this function is really meant to be used that way, and we either shouldn't return a completely different entity, or at least offer some way of getting an Account from the returned CredentialAccount. Potential ways to do this include:
- add a nullable
sourcetoAccountand get rid of the separateCredentialAccount - add a separate function (e.g.
getOwnAccount()) that internally still callsverifyCredentials()but returns data as anAccount(or possiblyAccount?if credentials can not be verified) - add a utility function that accepts a
CredentialAccountand returns anAccount