summaryrefslogtreecommitdiffstats
path: root/app/src/main/java/app/fedilab/android/mastodon/jobs/FetchHomeWorker.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/app/fedilab/android/mastodon/jobs/FetchHomeWorker.java')
-rw-r--r--app/src/main/java/app/fedilab/android/mastodon/jobs/FetchHomeWorker.java15
1 files changed, 1 insertions, 14 deletions
diff --git a/app/src/main/java/app/fedilab/android/mastodon/jobs/FetchHomeWorker.java b/app/src/main/java/app/fedilab/android/mastodon/jobs/FetchHomeWorker.java
index 0227b7ae8..477786b83 100644
--- a/app/src/main/java/app/fedilab/android/mastodon/jobs/FetchHomeWorker.java
+++ b/app/src/main/java/app/fedilab/android/mastodon/jobs/FetchHomeWorker.java
@@ -173,8 +173,7 @@ public class FetchHomeWorker extends Worker {
if (fetch_home) {
int max_calls = 10;
int status_per_page = 40;
- int insertValue = 0;
- StatusCache lastStatusCache = null;
+ int insertValue;
//Browse last 400 home messages
boolean canContinue = true;
int call = 0;
@@ -196,7 +195,6 @@ public class FetchHomeWorker extends Worker {
statusCache.status = status;
statusCache.type = Timeline.TimeLineEnum.HOME;
statusCache.status_id = status.id;
- lastStatusCache = statusCache;
try {
insertValue = statusCacheDAO.insertOrUpdate(statusCache, Timeline.TimeLineEnum.HOME.getValue());
if (insertValue == 1) {
@@ -249,17 +247,6 @@ public class FetchHomeWorker extends Worker {
} catch (DBException e) {
throw new RuntimeException(e);
}
- //insertValue is for last status and equals zero if updated or 1 if inserted
- if (lastStatusCache != null && insertValue == 1) { //Last inserted message was not in cache.
- StatusCache statusCacheDAO = new StatusCache(getApplicationContext());
- lastStatusCache.status.isFetchMore = true;
- lastStatusCache.status.positionFetchMore = Status.PositionFetchMore.TOP;
- try {
- statusCacheDAO.updateIfExists(lastStatusCache);
- } catch (DBException e) {
- throw new RuntimeException(e);
- }
- }
}
}