Some fixes with toots & bookmark for cache

This commit is contained in:
stom79 2018-11-24 17:39:44 +01:00
parent 1348a98f71
commit f65c7a9c42
2 changed files with 32 additions and 23 deletions

View File

@ -926,7 +926,10 @@ public class Status implements Parcelable{
for (final Mention mention : mentions) {
String targetedAccount = "@" + mention.getUsername();
if(spannableStringT.toString().toLowerCase().contains(("@" + mention.getAcct()).toLowerCase())) {
targetedAccount = "@" + mention.getAcct();
String fullname = mention.getAcct();
if( fullname.split("@").length == 1)
fullname += "@" + Helper.getLiveInstance(context);
targetedAccount = "@" + fullname;
if (spannableStringT.toString().toLowerCase().contains(targetedAccount.toLowerCase())) {
//Accounts can be mentioned several times so we have to loop
for (int startPosition = -1; (startPosition = spannableStringT.toString().toLowerCase().indexOf(targetedAccount.toLowerCase(), startPosition + 1)) != -1; startPosition++) {

View File

@ -293,7 +293,10 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
String bookmark;
if( context instanceof BaseMainActivity){
bookmark = ((BaseMainActivity) context).getBookmark();
if( bookmark != null)
asyncTask = new RetrieveFeedsAsyncTask(context, type, bookmark,true,DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
else
asyncTask = new RetrieveFeedsAsyncTask(context, type, null, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
firstTootsLoaded = false;
}
@ -324,7 +327,10 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
String bookmark;
if( context instanceof BaseMainActivity){
bookmark = ((BaseMainActivity) context).getBookmark();
asyncTask = new RetrieveFeedsAsyncTask(context, type, bookmark, true,DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
if( bookmark != null)
asyncTask = new RetrieveFeedsAsyncTask(context, type, bookmark,true,DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
else
asyncTask = new RetrieveFeedsAsyncTask(context, type, null, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
firstTootsLoaded = false;
}
}else {