Manage relationship for pixelfed

This commit is contained in:
tom79 2020-02-04 21:47:05 +01:00
parent 4d8c276d65
commit 06e3a3137d
2 changed files with 5 additions and 2 deletions

View File

@ -50,7 +50,7 @@ public class RetrieveRelationshipAsyncTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... params) {
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED) {
API api = new API(this.contextReference.get());
relationship = api.getRelationship(accountId);
error = api.getError();

View File

@ -2555,7 +2555,10 @@ public class API {
List<Relationship> relationships;
Relationship relationship = null;
HashMap<String, String> params = new HashMap<>();
params.put("id", accountId);
if( MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED)
params.put("id[]", accountId);
else
params.put("id", accountId);
try {
String response = new HttpsConnection(context, this.instance).get(getAbsoluteUrl("/accounts/relationships"), 10, params, prefKeyOauthTokenT);
relationships = parseRelationshipResponse(new JSONArray(response));