Removes statuses from cache when they are removed

This commit is contained in:
stom79 2018-02-17 16:21:26 +01:00
parent a703a7f1ad
commit fc24739566
1 changed files with 10 additions and 0 deletions

View File

@ -1581,6 +1581,11 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
if( status.getId().equals(targetedId)) {
statuses.remove(status);
statusListAdapter.notifyItemRemoved(position);
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
//Remove the status from cache also
try {
new StatusCacheDAO(context, db).remove(StatusCacheDAO.ARCHIVE_CACHE,status);
}catch (Exception ignored){}
break;
}
position++;
@ -1618,6 +1623,11 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
if( status.getReblogs_count() - 1 >= 0)
status.setReblogs_count(status.getReblogs_count() - 1);
statusListAdapter.notifyItemChanged(position);
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
//Remove the status from cache also
try {
new StatusCacheDAO(context, db).remove(StatusCacheDAO.ARCHIVE_CACHE,status);
}catch (Exception ignored){}
break;
}
position++;