diff options
author | stom79 <tschneider.ac@gmail.com> | 2018-08-20 19:00:20 +0200 |
---|---|---|
committer | stom79 <tschneider.ac@gmail.com> | 2018-08-20 19:00:20 +0200 |
commit | 57d30a3f2ee18562868dd383177656fffb12fd3c (patch) | |
tree | d16bf9ca64d9f0ac2651fd1b5c203f24010153c8 /app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveFeedsAsyncTask.java | |
parent | 7df2c0b59e5687ed8034425682bad059be74cf2f (diff) |
Remote instance follow - step1
Diffstat (limited to 'app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveFeedsAsyncTask.java')
-rw-r--r-- | app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveFeedsAsyncTask.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveFeedsAsyncTask.java b/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveFeedsAsyncTask.java index 072234d26..7cacba924 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveFeedsAsyncTask.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveFeedsAsyncTask.java @@ -47,6 +47,7 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> { private boolean showPinned = false; private WeakReference<Context> contextReference; private FilterToots filterToots; + private String instanceName; public enum Type{ HOME, @@ -60,7 +61,8 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> { CONTEXT, TAG, CACHE_BOOKMARKS, - CACHE_STATUS + CACHE_STATUS, + REMOTE_INSTANCE } @@ -79,6 +81,14 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> { this.listener = onRetrieveFeedsInterface; } + public RetrieveFeedsAsyncTask(Context context, Type action, String instanceName, String max_id, OnRetrieveFeedsInterface onRetrieveFeedsInterface){ + this.contextReference = new WeakReference<>(context); + this.action = action; + this.max_id = max_id; + this.listener = onRetrieveFeedsInterface; + this.instanceName = instanceName; + } + public RetrieveFeedsAsyncTask(Context context, Type action, String targetedID, String max_id, boolean showMediaOnly, boolean showPinned, OnRetrieveFeedsInterface onRetrieveFeedsInterface){ this.contextReference = new WeakReference<>(context); this.action = action; @@ -111,6 +121,9 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> { case PUBLIC: apiResponse = api.getPublicTimeline(false, max_id); break; + case REMOTE_INSTANCE: + apiResponse = api.getPublicTimeline(this.instanceName,false, max_id); + break; case FAVOURITES: apiResponse = api.getFavourites(max_id); break; |