Add post editing capability (#2828)

* Add post editing capability

* Don't try to reprocess already uploaded attachments.
Fixes editing posts with existing media

* Don't mark post edits as modified until editing occurs

* Disable UI for things that can't be edited when editing a post

* Finally convert SFragment to kotlin

* Use api endpoint for fetching status source for editing

* Apply review feedback
This commit is contained in:
Levi Bard 2022-12-08 10:18:12 +01:00 committed by GitHub
commit a6b6a40ba6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 676 additions and 527 deletions

View file

@ -65,6 +65,7 @@ class DraftHelper @Inject constructor(
failedToSend: Boolean,
scheduledAt: String?,
language: String?,
statusId: String?,
) = withContext(Dispatchers.IO) {
val externalFilesDir = context.getExternalFilesDir("Tusky")
@ -124,6 +125,7 @@ class DraftHelper @Inject constructor(
failedToSend = failedToSend,
scheduledAt = scheduledAt,
language = language,
statusId = statusId,
)
draftDao.insertOrReplace(draft)

View file

@ -111,6 +111,7 @@ class DraftsActivity : BaseActivity(), DraftActionListener {
visibility = draft.visibility,
scheduledAt = draft.scheduledAt,
language = draft.language,
statusId = draft.statusId,
)
bottomSheet.state = BottomSheetBehavior.STATE_HIDDEN
@ -147,6 +148,7 @@ class DraftsActivity : BaseActivity(), DraftActionListener {
visibility = draft.visibility,
scheduledAt = draft.scheduledAt,
language = draft.language,
statusId = draft.statusId,
)
startActivity(ComposeActivity.startIntent(this, composeOptions))