diff options
Diffstat (limited to 'app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveMissingFeedsAsyncTask.java')
-rw-r--r-- | app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveMissingFeedsAsyncTask.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveMissingFeedsAsyncTask.java b/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveMissingFeedsAsyncTask.java index b8fb4a9d9..243339257 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveMissingFeedsAsyncTask.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/RetrieveMissingFeedsAsyncTask.java @@ -23,6 +23,7 @@ import java.util.List; import fr.gouv.etalab.mastodon.activities.MainActivity; import fr.gouv.etalab.mastodon.client.API; import fr.gouv.etalab.mastodon.client.APIResponse; +import fr.gouv.etalab.mastodon.helper.Helper; import fr.gouv.etalab.mastodon.interfaces.OnRetrieveMissingFeedsInterface; @@ -58,11 +59,15 @@ public class RetrieveMissingFeedsAsyncTask extends AsyncTask<Void, Void, Void> { @Override protected Void doInBackground(Void... params) { + if( this.contextReference.get() == null) + return null; API api = new API(this.contextReference.get()); List<fr.gouv.etalab.mastodon.client.Entities.Status> tempStatus; APIResponse apiResponse = null; if( type == RetrieveFeedsAsyncTask.Type.HOME) apiResponse = api.getHomeTimeline(since_id); + else if( type == RetrieveFeedsAsyncTask.Type.DIRECT) + apiResponse = api.getDirectTimelineSinceId(since_id); else if( type == RetrieveFeedsAsyncTask.Type.LOCAL) apiResponse = api.getPublicTimelineSinceId(true, since_id); else if( type == RetrieveFeedsAsyncTask.Type.PUBLIC) |