Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message Queue bug fixes #4384

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ import com.nextcloud.talk.adapters.messages.IncomingPreviewMessageViewHolder
import com.nextcloud.talk.adapters.messages.IncomingTextMessageViewHolder
import com.nextcloud.talk.adapters.messages.IncomingVoiceMessageViewHolder
import com.nextcloud.talk.adapters.messages.MessagePayload
import com.nextcloud.talk.adapters.messages.OutcomingDeckCardViewHolder
import com.nextcloud.talk.adapters.messages.OutcomingLinkPreviewMessageViewHolder
import com.nextcloud.talk.adapters.messages.OutcomingLocationMessageViewHolder
import com.nextcloud.talk.adapters.messages.OutcomingPollMessageViewHolder
import com.nextcloud.talk.adapters.messages.OutcomingPreviewMessageViewHolder
import com.nextcloud.talk.adapters.messages.OutcomingTextMessageViewHolder
import com.nextcloud.talk.adapters.messages.OutcomingVoiceMessageViewHolder
import com.nextcloud.talk.adapters.messages.OutcomingDeckCardViewHolder
import com.nextcloud.talk.adapters.messages.PreviewMessageInterface
import com.nextcloud.talk.adapters.messages.PreviewMessageViewHolder
import com.nextcloud.talk.adapters.messages.SystemMessageInterface
Expand Down Expand Up @@ -540,7 +540,6 @@ class ChatActivity :

messageInputViewModel.messageQueueFlow.observe(this) { list ->
list.forEachIndexed { _, qMsg ->
Log.d("Julius", "Message recieved: ${qMsg.message}")
val temporaryChatMessage = ChatMessage()
temporaryChatMessage.jsonMessageId = -3
temporaryChatMessage.actorId = "-3"
Expand All @@ -565,7 +564,6 @@ class ChatActivity :
pos = adapter?.getMessagePositionById("-3")
}
adapter?.notifyDataSetChanged()
Log.d("Julius", "End i: $i")
}
}

Expand Down Expand Up @@ -664,13 +662,13 @@ class ChatActivity :
withCredentials = credentials!!,
withUrl = urlForChatting
)
messageInputViewModel.getTempMessagesFromMessageQueue(currentConversation!!.internalId)
}
} else {
Log.w(
TAG,
"currentConversation was null in observer ChatViewModel.GetCapabilitiesInitialLoadState"
)
messageInputViewModel.getTempMessagesFromMessageQueue(currentConversation!!.internalId)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ class MessageInputFragment : Fragment() {
}

chatActivity.messageInputViewModel.messageQueueSizeFlow.observe(viewLifecycleOwner) { size ->
Log.d("Julius", "MessageQueueSizeFlow recieved: $size")

if (size > 0) {
binding.fragmentConnectionLost.text = getString(R.string.connection_lost_queued, size)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ class MessageInputViewModel @Inject constructor(
val queue = dataStore.getMessageQueue(internalId)
val list = mutableListOf<QueuedMessage>()
for (msg in queue) {
Log.d("Julius", "Msg: ${msg.message}")
list.add(msg)
}
_messageQueueFlow.postValue(list)
Expand Down
Loading