Fix crash + add gab.ai block

This commit is contained in:
tom79 2019-06-03 07:42:46 +02:00
parent bd612583cc
commit 8b50ce0b2a
2 changed files with 2 additions and 2 deletions

View File

@ -273,7 +273,7 @@ public class LoginActivity extends BaseActivity {
return; return;
} }
instance = login_instance.getText().toString().trim().toLowerCase(); instance = login_instance.getText().toString().trim().toLowerCase();
if(instance.endsWith(".gab.com") || instance.equals("gab.com")){ if(instance.endsWith(".gab.com") || instance.equals("gab.com") || instance.endsWith(".gab.ai") || instance.equals("gab.ai")){
Toasty.error(LoginActivity.this,getString(R.string.client_error), Toast.LENGTH_LONG).show(); Toasty.error(LoginActivity.this,getString(R.string.client_error), Toast.LENGTH_LONG).show();
return; return;
} }

View File

@ -954,7 +954,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
ArrayList<Status> tmpStatuses = new ArrayList<>(); ArrayList<Status> tmpStatuses = new ArrayList<>();
for (Status tmpStatus : statuses) { for (Status tmpStatus : statuses) {
//Put the toot at its place in the list (id desc) //Put the toot at its place in the list (id desc)
if( !apiResponse.isFetchmore() && !this.statuses.contains(tmpStatus) && tmpStatus.getCreated_at() != null && this.statuses.get(0).getCreated_at() != null && tmpStatus.getCreated_at().after(this.statuses.get(0).getCreated_at())) { //Element not already added if( !apiResponse.isFetchmore() && this.statuses.size() > 0 && !this.statuses.contains(tmpStatus) && tmpStatus.getCreated_at() != null && this.statuses.get(0).getCreated_at() != null && tmpStatus.getCreated_at().after(this.statuses.get(0).getCreated_at())) { //Element not already added
//Mark status at new ones when their id is greater than the last read toot id //Mark status at new ones when their id is greater than the last read toot id
if (type == RetrieveFeedsAsyncTask.Type.HOME && lastReadTootDate != null && tmpStatus.getCreated_at().after(lastReadTootDate) ) { if (type == RetrieveFeedsAsyncTask.Type.HOME && lastReadTootDate != null && tmpStatus.getCreated_at().after(lastReadTootDate) ) {
tmpStatus.setNew(true); tmpStatus.setNew(true);