This commit is contained in:
stom79 2017-12-07 17:48:03 +01:00
parent 0eb57c6cc0
commit ade2cca590
2 changed files with 12 additions and 5 deletions

View File

@ -45,6 +45,7 @@ import com.bumptech.glide.request.transition.Transition;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.regex.Matcher;
import fr.gouv.etalab.mastodon.activities.HashTagActivity;
@ -741,4 +742,12 @@ public class Status implements Parcelable {
public void setFetchMore(boolean fetchMore) {
this.fetchMore = fetchMore;
}
@Override
public boolean equals(Object otherStatus) {
return otherStatus != null && (otherStatus == this || otherStatus instanceof Status && this.getId().equals(((Status) otherStatus).getId()));
}
}

View File

@ -285,11 +285,9 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
int lastLoop = 0;
for (Status tmpStatus : statuses) {
//Mark status at new ones when their id is greater than the bookmark id / Also increments counter
if (bookmark != null) {
if (Long.parseLong(tmpStatus.getId()) > Long.parseLong(bookmark)) {
tmpStatus.setNew(true);
MainActivity.countNewStatus++;
}
if (Long.parseLong(tmpStatus.getId()) > Long.parseLong(bookmark)) {
tmpStatus.setNew(true);
MainActivity.countNewStatus++;
}
//Put the toot at its place in the list (id desc)
if (this.statuses != null) {