Browse Source

Fix build after logical conflict (#4036)

Ugh, I didn't notice that #3480 was affected by the notification
fragment rollback
pull/3552/head
Levi Bard 3 years ago committed by GitHub
parent
commit
2dceecb591
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java
  2. 12
      app/src/main/java/com/keylesspalace/tusky/usecase/TimelineCases.kt

16
app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java

@ -61,12 +61,9 @@ import com.keylesspalace.tusky.R;
import com.keylesspalace.tusky.adapter.NotificationsAdapter;
import com.keylesspalace.tusky.adapter.StatusBaseViewHolder;
import com.keylesspalace.tusky.appstore.BlockEvent;
import com.keylesspalace.tusky.appstore.BookmarkEvent;
import com.keylesspalace.tusky.appstore.EventHub;
import com.keylesspalace.tusky.appstore.FavoriteEvent;
import com.keylesspalace.tusky.appstore.PinEvent;
import com.keylesspalace.tusky.appstore.PreferenceChangedEvent;
import com.keylesspalace.tusky.appstore.ReblogEvent;
import com.keylesspalace.tusky.appstore.StatusChangedEvent;
import com.keylesspalace.tusky.components.notifications.NotificationHelper;
import com.keylesspalace.tusky.databinding.FragmentTimelineNotificationsBinding;
import com.keylesspalace.tusky.db.AccountEntity;
@ -389,14 +386,9 @@ public class NotificationsFragment extends SFragment implements
.observeOn(AndroidSchedulers.mainThread())
.to(autoDisposable(from(this, Lifecycle.Event.ON_DESTROY)))
.subscribe(event -> {
if (event instanceof FavoriteEvent) {
setFavouriteForStatus(((FavoriteEvent) event).getStatusId(), ((FavoriteEvent) event).getFavourite());
} else if (event instanceof BookmarkEvent) {
setBookmarkForStatus(((BookmarkEvent) event).getStatusId(), ((BookmarkEvent) event).getBookmark());
} else if (event instanceof ReblogEvent) {
setReblogForStatus(((ReblogEvent) event).getStatusId(), ((ReblogEvent) event).getReblog());
} else if (event instanceof PinEvent) {
setPinForStatus(((PinEvent) event).getStatusId(), ((PinEvent) event).getPinned());
if (event instanceof StatusChangedEvent) {
Status updatedStatus = ((StatusChangedEvent) event).getStatus();
updateStatus(updatedStatus.getActionableId(), s -> updatedStatus);
} else if (event instanceof BlockEvent) {
removeAllByAccountId(((BlockEvent) event).getAccountId());
} else if (event instanceof PreferenceChangedEvent) {

12
app/src/main/java/com/keylesspalace/tusky/usecase/TimelineCases.kt

@ -91,8 +91,8 @@ class TimelineCases @Inject constructor(
} else {
mastodonApi.unreblogStatusOld(statusId)
}
return call.doAfterSuccess {
eventHub.dispatchOld(ReblogEvent(statusId, reblog))
return call.doAfterSuccess { status ->
eventHub.dispatchOld(StatusChangedEvent(status))
}
}
@ -102,8 +102,8 @@ class TimelineCases @Inject constructor(
} else {
mastodonApi.unfavouriteStatusOld(statusId)
}
return call.doAfterSuccess {
eventHub.dispatchOld(FavoriteEvent(statusId, favourite))
return call.doAfterSuccess { status ->
eventHub.dispatchOld(StatusChangedEvent(status))
}
}
@ -113,8 +113,8 @@ class TimelineCases @Inject constructor(
} else {
mastodonApi.unbookmarkStatusOld(statusId)
}
return call.doAfterSuccess {
eventHub.dispatchOld(BookmarkEvent(statusId, bookmark))
return call.doAfterSuccess { status ->
eventHub.dispatchOld(StatusChangedEvent(status))
}
}

Loading…
Cancel
Save