mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed missing composing notifications
This commit is contained in:
parent
a5b8a8a683
commit
37c23066f0
2 changed files with 21 additions and 13 deletions
|
|
@ -275,15 +275,21 @@ open class ConversationFragment : SlidingPaneChildFragment() {
|
|||
}
|
||||
|
||||
override fun afterTextChanged(p0: Editable?) {
|
||||
sendMessageViewModel.closeParticipantsList()
|
||||
if (viewModel.isGroup.value == true) {
|
||||
sendMessageViewModel.closeParticipantsList()
|
||||
|
||||
val split = p0.toString().split(" ")
|
||||
for (part in split) {
|
||||
if (part == "@") {
|
||||
Log.i("$TAG '@' found, opening participants list")
|
||||
sendMessageViewModel.openParticipantsList()
|
||||
val split = p0.toString().split(" ")
|
||||
for (part in split) {
|
||||
if (part == "@") {
|
||||
Log.i("$TAG '@' found, opening participants list")
|
||||
sendMessageViewModel.openParticipantsList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (p0.toString().isNotEmpty()) {
|
||||
sendMessageViewModel.notifyChatMessageIsBeingComposed()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -786,13 +792,6 @@ open class ConversationFragment : SlidingPaneChildFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
viewModel.isGroup.observe(viewLifecycleOwner) { group ->
|
||||
if (group) {
|
||||
Log.i("$TAG Adding text observer to message sending area")
|
||||
binding.sendArea.messageToSend.addTextChangedListener(textObserver)
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.messageDeletedEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
val message = getString(R.string.conversation_message_deleted_toast)
|
||||
|
|
@ -946,6 +945,8 @@ open class ConversationFragment : SlidingPaneChildFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
binding.sendArea.messageToSend.addTextChangedListener(textObserver)
|
||||
|
||||
scrollListener = object : ConversationScrollListener(layoutManager) {
|
||||
@UiThread
|
||||
override fun onLoadMore(totalItemsCount: Int) {
|
||||
|
|
|
|||
|
|
@ -321,6 +321,13 @@ class SendMessageInConversationViewModel
|
|||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun notifyChatMessageIsBeingComposed() {
|
||||
coreContext.postOnCoreThread {
|
||||
chatRoom.compose()
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun openParticipantsList() {
|
||||
isParticipantsListOpen.value = true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue