Skip to content

Commit

Permalink
Merge pull request #4139 from nextcloud/bugfix/4010/fixSendTextToTalkApp
Browse files Browse the repository at this point in the history
fix to display text that was sent to app via "share to"
  • Loading branch information
mahibi authored Sep 6, 2024
2 parents 619d0f3 + 07cd9e1 commit 129ba94
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,13 @@ class MessageInputFragment : Fragment() {
}

private fun restoreState() {
requireContext().getSharedPreferences(chatActivity.localClassName, AppCompatActivity.MODE_PRIVATE).apply {
val text = getString(chatActivity.roomToken, "")
val cursor = getInt(chatActivity.roomToken + CURSOR_KEY, 0)
binding.fragmentMessageInputView.messageInput.setText(text)
binding.fragmentMessageInputView.messageInput.setSelection(cursor)
if (binding.fragmentMessageInputView.inputEditText.text.isEmpty()) {
requireContext().getSharedPreferences(chatActivity.localClassName, AppCompatActivity.MODE_PRIVATE).apply {
val text = getString(chatActivity.roomToken, "")
val cursor = getInt(chatActivity.roomToken + CURSOR_KEY, 0)
binding.fragmentMessageInputView.messageInput.setText(text)
binding.fragmentMessageInputView.messageInput.setSelection(cursor)
}
}
}

Expand Down

0 comments on commit 129ba94

Please sign in to comment.