fix unparsed html in "replying to" toggle (#2448)
This commit is contained in:
parent
7499ff5733
commit
43709532d6
3 changed files with 9 additions and 6 deletions
|
@ -35,6 +35,7 @@ import com.keylesspalace.tusky.components.compose.ComposeActivity
|
|||
import com.keylesspalace.tusky.databinding.ActivityDraftsBinding
|
||||
import com.keylesspalace.tusky.db.DraftEntity
|
||||
import com.keylesspalace.tusky.di.ViewModelFactory
|
||||
import com.keylesspalace.tusky.util.parseAsMastodonHtml
|
||||
import com.keylesspalace.tusky.util.visible
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
|
@ -100,7 +101,7 @@ class DraftsActivity : BaseActivity(), DraftActionListener {
|
|||
content = draft.content,
|
||||
contentWarning = draft.contentWarning,
|
||||
inReplyToId = draft.inReplyToId,
|
||||
replyingStatusContent = status.content.toString(),
|
||||
replyingStatusContent = status.content.parseAsMastodonHtml().toString(),
|
||||
replyingStatusAuthor = status.account.localUsername,
|
||||
draftAttachments = draft.attachments,
|
||||
poll = draft.poll,
|
||||
|
|
|
@ -97,7 +97,7 @@ class SearchStatusesFragment : SearchFragment<StatusViewData.Concrete>(), Status
|
|||
}
|
||||
|
||||
override fun onReply(position: Int) {
|
||||
searchAdapter.peek(position)?.status?.let { status ->
|
||||
searchAdapter.peek(position)?.let { status ->
|
||||
reply(status)
|
||||
}
|
||||
}
|
||||
|
@ -199,8 +199,8 @@ class SearchStatusesFragment : SearchFragment<StatusViewData.Concrete>(), Status
|
|||
fun newInstance() = SearchStatusesFragment()
|
||||
}
|
||||
|
||||
private fun reply(status: Status) {
|
||||
val actionableStatus = status.actionableStatus
|
||||
private fun reply(status: StatusViewData.Concrete) {
|
||||
val actionableStatus = status.actionable
|
||||
val mentionedUsernames = actionableStatus.mentions.map { it.username }
|
||||
.toMutableSet()
|
||||
.apply {
|
||||
|
@ -216,7 +216,7 @@ class SearchStatusesFragment : SearchFragment<StatusViewData.Concrete>(), Status
|
|||
contentWarning = actionableStatus.spoilerText,
|
||||
mentionedUsernames = mentionedUsernames,
|
||||
replyingStatusAuthor = actionableStatus.account.localUsername,
|
||||
replyingStatusContent = actionableStatus.content.toString()
|
||||
replyingStatusContent = status.content.toString()
|
||||
)
|
||||
)
|
||||
startActivity(intent)
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
package com.keylesspalace.tusky.fragment;
|
||||
|
||||
import static com.keylesspalace.tusky.util.StatusParsingHelper.parseAsMastodonHtml;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.DownloadManager;
|
||||
import android.content.ClipData;
|
||||
|
@ -150,7 +152,7 @@ public abstract class SFragment extends Fragment implements Injectable {
|
|||
composeOptions.setContentWarning(contentWarning);
|
||||
composeOptions.setMentionedUsernames(mentionedUsernames);
|
||||
composeOptions.setReplyingStatusAuthor(actionableStatus.getAccount().getLocalUsername());
|
||||
composeOptions.setReplyingStatusContent(actionableStatus.getContent().toString());
|
||||
composeOptions.setReplyingStatusContent(parseAsMastodonHtml(actionableStatus.getContent()).toString());
|
||||
|
||||
Intent intent = ComposeActivity.startIntent(getContext(), composeOptions);
|
||||
getActivity().startActivity(intent);
|
||||
|
|
Loading…
Reference in a new issue