diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/AccountTimelineFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/AccountTimelineFragment.java index 4c27e7a9..0bfe2906 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/AccountTimelineFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/AccountTimelineFragment.java @@ -85,18 +85,18 @@ public class AccountTimelineFragment extends StatusListFragment{ loadData(); } - protected void onStatusCreated(StatusCreatedEvent ev){ - if(!AccountSessionManager.getInstance().isSelf(accountID, ev.status.account)) + protected void onStatusCreated(Status status){ + if(!AccountSessionManager.getInstance().isSelf(accountID, status.account)) return; if(filter==GetAccountStatuses.Filter.DEFAULT){ // Keep replies to self, discard all other replies - if(ev.status.inReplyToAccountId!=null && !ev.status.inReplyToAccountId.equals(AccountSessionManager.getInstance().getAccount(accountID).self.id)) + if(status.inReplyToAccountId!=null && !status.inReplyToAccountId.equals(AccountSessionManager.getInstance().getAccount(accountID).self.id)) return; }else if(filter==GetAccountStatuses.Filter.MEDIA){ - if(ev.status.mediaAttachments.isEmpty()) + if(status.mediaAttachments.isEmpty()) return; } - prependItems(Collections.singletonList(ev.status), true); + prependItems(Collections.singletonList(status), true); } @Override diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java index 1c7b6404..02763ca4 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java @@ -167,8 +167,8 @@ public class HomeTimelineFragment extends StatusListFragment{ } } - public void onStatusCreated(StatusCreatedEvent ev){ - prependItems(Collections.singletonList(ev.status), true); + public void onStatusCreated(Status status){ + prependItems(Collections.singletonList(status), true); } private void onFabClick(View v){ diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java index e0b0b41d..de915e4c 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java @@ -63,26 +63,26 @@ public abstract class StatusListFragment extends BaseStatusListFragment{ Nav.go(getActivity(), ThreadFragment.class, args); } - protected void onStatusCreated(StatusCreatedEvent ev){} + protected void onStatusCreated(Status status){} - protected void onStatusUpdated(StatusUpdatedEvent ev){ + protected void onStatusUpdated(Status status){ ArrayList statusesForDisplayItems=new ArrayList<>(); for(int i=0;i{ public void onStatusCreated(StatusCreatedEvent ev){ if(!ev.accountID.equals(accountID)) return; - StatusListFragment.this.onStatusCreated(ev); + StatusListFragment.this.onStatusCreated(ev.status.clone()); } @Subscribe public void onStatusUpdated(StatusUpdatedEvent ev){ - StatusListFragment.this.onStatusUpdated(ev); + StatusListFragment.this.onStatusUpdated(ev.status); } @Subscribe diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java index ceb7e760..674ef189 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java @@ -125,9 +125,10 @@ public class ThreadFragment extends StatusListFragment{ footerProgress.setVisibility(View.VISIBLE); } - protected void onStatusCreated(StatusCreatedEvent ev){ - if(ev.status.inReplyToId!=null && getStatusByID(ev.status.inReplyToId)!=null){ - onAppendItems(Collections.singletonList(ev.status)); + protected void onStatusCreated(Status status){ + if(status.inReplyToId!=null && getStatusByID(status.inReplyToId)!=null){ + onAppendItems(Collections.singletonList(status)); + data.add(status); } }