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

Fixed bug that hides message input upon joining open conversations #4567

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
21 changes: 5 additions & 16 deletions app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,7 @@ class ChatActivity :
val delayForRecursiveCall = if (shouldShowLobby()) {
GET_ROOM_INFO_DELAY_LOBBY
} else {
GET_ROOM_INFO_DELAY_NORMAL
GET_ROOM_INFO_DELAY_LOBBY
}

if (getRoomInfoTimerHandler == null) {
Expand Down Expand Up @@ -1752,7 +1752,7 @@ class ChatActivity :
val curMsg = adapter?.items?.getOrNull(index - i)?.item
if (curMsg is ChatMessage) {
if (nextMessage == null && i > 0) {
nextMessage = curMsg as ChatMessage
nextMessage = curMsg
}

if (curMsg.isVoiceMessage) {
Expand All @@ -1763,7 +1763,7 @@ class ChatActivity :
val filename = curMsg.selectedIndividualHashMap!!["name"]
val file = File(context.cacheDir, filename!!)
if (!file.exists()) {
downloadFileToCache(curMsg as ChatMessage, false) {
downloadFileToCache(curMsg, false) {
curMsg.isDownloadingVoiceMessage = false
curMsg.voiceMessageDuration = try {
val retriever = MediaMetadataRetriever()
Expand Down Expand Up @@ -2144,17 +2144,6 @@ class ChatActivity :
}
}

private fun checkShowMessageInputView() {
if (isReadOnlyConversation() ||
shouldShowLobby() ||
!participantPermissions.hasChatPermission()
) {
binding.fragmentContainerActivityChat.visibility = View.GONE
} else {
binding.fragmentContainerActivityChat.visibility = View.VISIBLE
}
}

private fun shouldShowLobby(): Boolean {
if (currentConversation != null) {
return CapabilitiesUtil.hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.WEBINARY_LOBBY) &&
Expand Down Expand Up @@ -2230,12 +2219,12 @@ class ChatActivity :
} else {
binding.lobby.lobbyView.visibility = View.GONE
binding.messagesListView.visibility = View.VISIBLE
checkShowMessageInputView()
binding.fragmentContainerActivityChat.visibility = View.VISIBLE
}
} else {
binding.lobby.lobbyView.visibility = View.GONE
binding.messagesListView.visibility = View.VISIBLE
checkShowMessageInputView()
binding.fragmentContainerActivityChat.visibility = View.VISIBLE
}
}

Expand Down
Loading