Fix conversation refresh
This commit is contained in:
parent
0b7491c40a
commit
6bd495ea10
|
@ -227,12 +227,14 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
|||
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
if( statuses.size() > 0) {
|
||||
if( type == RetrieveFeedsAsyncTask.Type.HOME)
|
||||
MainActivity.countNewStatus = 0;
|
||||
isSwipped = true;
|
||||
if( type == RetrieveFeedsAsyncTask.Type.HOME)
|
||||
MainActivity.countNewStatus = 0;
|
||||
isSwipped = true;
|
||||
if( type != RetrieveFeedsAsyncTask.Type.CONVERSATION)
|
||||
retrieveMissingToots(null);
|
||||
}
|
||||
else if( statuses.size() > 0)
|
||||
retrieveMissingToots(statuses.get(0).getId());
|
||||
|
||||
}
|
||||
});
|
||||
else
|
||||
|
@ -721,6 +723,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
|||
int insertedConversation = 0;
|
||||
if(type == RetrieveFeedsAsyncTask.Type.CONVERSATION){ //Remove conversation already displayed if new messages
|
||||
int position = 0;
|
||||
insertedConversation = statuses.size();
|
||||
if( this.statuses != null) {
|
||||
long initialConversationId = -1;
|
||||
if( this.statuses.size() > 0 )
|
||||
|
@ -728,8 +731,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
|
|||
for (Iterator<Status> it = this.statuses.iterator(); it.hasNext(); ) {
|
||||
Status status = it.next();
|
||||
for (Status status1 : statuses) {
|
||||
if(initialConversationId > 0 && Long.parseLong(status1.getConversationId()) > initialConversationId)
|
||||
insertedConversation++;
|
||||
if (status.getConversationId() != null && status.getConversationId().equals(status1.getConversationId())) {
|
||||
statusListAdapter.notifyItemRemoved(position);
|
||||
it.remove();
|
||||
|
|
Loading…
Reference in New Issue