improve local status updates (#3480)

The idea here is: Everytime we get hold of a new version of a post, we
update everything about that post everywhere.
This makes the distincion between different event types unnecessary, as
everythng is just a `StatusChangedEvent`.
The main benefit is that posts should be up-to-date more often, which is
important considering there is now editing and #3413
This commit is contained in:
Konrad Pozniak 2023-09-26 09:08:58 +02:00 committed by GitHub
commit 54e92b2156
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 145 additions and 198 deletions

View file

@ -21,8 +21,8 @@ import at.connyduck.calladapter.networkresult.fold
import com.keylesspalace.tusky.MainActivity
import com.keylesspalace.tusky.R
import com.keylesspalace.tusky.appstore.EventHub
import com.keylesspalace.tusky.appstore.StatusChangedEvent
import com.keylesspalace.tusky.appstore.StatusComposedEvent
import com.keylesspalace.tusky.appstore.StatusEditedEvent
import com.keylesspalace.tusky.appstore.StatusScheduledEvent
import com.keylesspalace.tusky.components.compose.MediaUploader
import com.keylesspalace.tusky.components.compose.UploadEvent
@ -253,7 +253,7 @@ class SendStatusService : Service(), Injectable {
if (scheduled) {
eventHub.dispatch(StatusScheduledEvent(sentStatus))
} else if (!isNew) {
eventHub.dispatch(StatusEditedEvent(statusToSend.statusId!!, sentStatus))
eventHub.dispatch(StatusChangedEvent(sentStatus))
} else {
eventHub.dispatch(StatusComposedEvent(sentStatus))
}