diff --git a/app/src/androidTest/java/com/nextcloud/talk/data/database/dao/ChatBlocksDaoTest.kt b/app/src/androidTest/java/com/nextcloud/talk/data/database/dao/ChatBlocksDaoTest.kt index f832a97d53b..6b2b06ecfa4 100644 --- a/app/src/androidTest/java/com/nextcloud/talk/data/database/dao/ChatBlocksDaoTest.kt +++ b/app/src/androidTest/java/com/nextcloud/talk/data/database/dao/ChatBlocksDaoTest.kt @@ -52,7 +52,6 @@ class ChatBlocksDaoTest { @Test fun testGetConnectedChatBlocks() = runTest { - usersDao.saveUser(createUserEntity("account1", "Account 1")) val account1 = usersDao.getUserWithUserId("account1").blockingGet() @@ -67,7 +66,7 @@ class ChatBlocksDaoTest { accountId = account1.id, "def", roomName = "Conversation Two" - ), + ) ) ) diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt index e7a287f0548..ad884edfd43 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt @@ -13,12 +13,10 @@ import android.text.TextUtils import android.util.Log import android.view.View import androidx.core.content.ContextCompat -import androidx.lifecycle.lifecycleScope import autodagger.AutoInjector import coil.load import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R -import com.nextcloud.talk.adapters.messages.OutcomingPollMessageViewHolder.Companion import com.nextcloud.talk.api.NcApi import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt index f2ff49947f6..ec86370242d 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt @@ -20,13 +20,11 @@ import android.view.MotionEvent import android.view.View import android.webkit.WebView import android.webkit.WebViewClient -import androidx.lifecycle.lifecycleScope import autodagger.AutoInjector import coil.load import com.google.android.material.snackbar.Snackbar import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R -import com.nextcloud.talk.adapters.messages.IncomingPollMessageViewHolder.Companion import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication import com.nextcloud.talk.chat.ChatActivity diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt index 3e35fe070c4..486fb62868e 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt @@ -12,12 +12,10 @@ import android.text.TextUtils import android.util.Log import android.view.View import androidx.core.content.ContextCompat -import androidx.lifecycle.lifecycleScope import autodagger.AutoInjector import coil.load import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R -import com.nextcloud.talk.adapters.messages.IncomingTextMessageViewHolder.Companion import com.nextcloud.talk.api.NcApi import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt index e44901a8189..df820d63a92 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt @@ -15,7 +15,6 @@ import android.util.Log import android.util.TypedValue import android.view.View import androidx.core.content.ContextCompat -import androidx.lifecycle.lifecycleScope import autodagger.AutoInjector import coil.load import com.nextcloud.android.common.ui.theme.utils.ColorRole @@ -37,9 +36,7 @@ import com.nextcloud.talk.utils.preferences.AppPreferences import com.stfalcon.chatkit.messages.MessageHolders import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.first -import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import javax.inject.Inject diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLinkPreviewMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLinkPreviewMessageViewHolder.kt index 94386c11afb..5e7202543e8 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLinkPreviewMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLinkPreviewMessageViewHolder.kt @@ -12,12 +12,10 @@ import android.content.Context import android.util.Log import android.view.View import androidx.appcompat.content.res.AppCompatResources -import androidx.lifecycle.lifecycleScope import autodagger.AutoInjector import coil.load import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R -import com.nextcloud.talk.adapters.messages.OutcomingPollMessageViewHolder.Companion import com.nextcloud.talk.api.NcApi import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication @@ -164,32 +162,32 @@ class OutcomingLinkPreviewMessageViewHolder(outcomingView: View, payload: Any) : message.parentMessageId!! ).first() } - parentChatMessage.activeUser = message.activeUser - parentChatMessage.imageUrl?.let { - binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE - binding.messageQuote.quotedMessageImage.load(it) { - addHeader( - "Authorization", - ApiUtils.getCredentials(message.activeUser!!.username, message.activeUser!!.token)!! - ) - } - } ?: run { - binding.messageQuote.quotedMessageImage.visibility = View.GONE - } - binding.messageQuote.quotedMessageAuthor.text = parentChatMessage.actorDisplayName - ?: context.getText(R.string.nc_nick_guest) - binding.messageQuote.quotedMessage.text = messageUtils - .enrichChatReplyMessageText( - binding.messageQuote.quotedMessage.context, - parentChatMessage, - false, - viewThemeUtils + parentChatMessage.activeUser = message.activeUser + parentChatMessage.imageUrl?.let { + binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE + binding.messageQuote.quotedMessageImage.load(it) { + addHeader( + "Authorization", + ApiUtils.getCredentials(message.activeUser!!.username, message.activeUser!!.token)!! ) - viewThemeUtils.talk.colorOutgoingQuoteText(binding.messageQuote.quotedMessage) - viewThemeUtils.talk.colorOutgoingQuoteAuthorText(binding.messageQuote.quotedMessageAuthor) - viewThemeUtils.talk.colorOutgoingQuoteBackground(binding.messageQuote.quoteColoredView) - - binding.messageQuote.quotedChatMessageView.visibility = View.VISIBLE + } + } ?: run { + binding.messageQuote.quotedMessageImage.visibility = View.GONE + } + binding.messageQuote.quotedMessageAuthor.text = parentChatMessage.actorDisplayName + ?: context.getText(R.string.nc_nick_guest) + binding.messageQuote.quotedMessage.text = messageUtils + .enrichChatReplyMessageText( + binding.messageQuote.quotedMessage.context, + parentChatMessage, + false, + viewThemeUtils + ) + viewThemeUtils.talk.colorOutgoingQuoteText(binding.messageQuote.quotedMessage) + viewThemeUtils.talk.colorOutgoingQuoteAuthorText(binding.messageQuote.quotedMessageAuthor) + viewThemeUtils.talk.colorOutgoingQuoteBackground(binding.messageQuote.quoteColoredView) + + binding.messageQuote.quotedChatMessageView.visibility = View.VISIBLE } catch (e: Exception) { Log.d(TAG, "Error when processing parent message in view holder", e) } diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLocationMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLocationMessageViewHolder.kt index f9208eb2e88..adf6c5f2426 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLocationMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLocationMessageViewHolder.kt @@ -18,14 +18,12 @@ import android.view.View import android.webkit.WebView import android.webkit.WebViewClient import androidx.appcompat.content.res.AppCompatResources -import androidx.lifecycle.lifecycleScope import autodagger.AutoInjector import coil.load import com.google.android.flexbox.FlexboxLayout import com.google.android.material.snackbar.Snackbar import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R -import com.nextcloud.talk.adapters.messages.IncomingPollMessageViewHolder.Companion import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication import com.nextcloud.talk.chat.ChatActivity diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingPollMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingPollMessageViewHolder.kt index 18473daeabd..5201229a094 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingPollMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingPollMessageViewHolder.kt @@ -12,12 +12,10 @@ import android.content.Context import android.util.Log import android.view.View import androidx.appcompat.content.res.AppCompatResources -import androidx.lifecycle.lifecycleScope import autodagger.AutoInjector import coil.load import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R -import com.nextcloud.talk.adapters.messages.IncomingPollMessageViewHolder.Companion import com.nextcloud.talk.api.NcApi import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt index 474999af033..2c481dbaf96 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt @@ -17,14 +17,12 @@ import android.view.View import android.widget.SeekBar import androidx.appcompat.content.res.AppCompatResources import androidx.core.content.ContextCompat -import androidx.lifecycle.lifecycleScope import androidx.work.WorkInfo import androidx.work.WorkManager import autodagger.AutoInjector import coil.load import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R -import com.nextcloud.talk.adapters.messages.IncomingPollMessageViewHolder.Companion import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication import com.nextcloud.talk.chat.ChatActivity diff --git a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt index 987d3695827..99b41223654 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt @@ -162,7 +162,6 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_INTERNAL_USER_ID import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_BREAKOUT_ROOM import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_MODERATOR import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_RECORDING_STATE -import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ID import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_START_CALL_AFTER_ROOM_SWITCH import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_SWITCH_TO_ROOM @@ -187,7 +186,6 @@ import kotlinx.coroutines.withContext import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode import retrofit2.HttpException -import retrofit2.Response import java.io.File import java.io.IOException import java.net.HttpURLConnection @@ -291,6 +289,7 @@ class ChatActivity : var newMessagesCount = 0 var startCallFromNotification: Boolean = false var startCallFromRoomSwitch: Boolean = false + // lateinit var roomId: String var voiceOnly: Boolean = true private lateinit var path: String @@ -600,7 +599,7 @@ class ChatActivity : chatViewModel.loadMessages( withCredentials = credentials!!, - withUrl = urlForChatting, + withUrl = urlForChatting ) } @@ -985,7 +984,8 @@ class ChatActivity : if (newState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) { if (layoutManager!!.findFirstCompletelyVisibleItemPosition() > 0 && - !binding.unreadMessagesPopup.isShown) { + !binding.unreadMessagesPopup.isShown + ) { binding.scrollDownButton.visibility = View.VISIBLE } else { binding.scrollDownButton.visibility = View.GONE @@ -2504,7 +2504,6 @@ class ChatActivity : unreadChatMessage.message = context.getString(R.string.nc_new_messages) adapter?.addToStart(unreadChatMessage, false) - if (scrollToEndOnUpdate) { binding.scrollDownButton.visibility = View.GONE newMessagesCount = 0 @@ -2519,7 +2518,6 @@ class ChatActivity : } } - for (chatMessage in chatMessageList) { chatMessage.activeUser = conversationUser @@ -2630,7 +2628,6 @@ class ChatActivity : // see getImageUrl() source code setUpWaveform(currentlyPlayedVoiceMessage!!, voiceMessageToRestoreWasPlaying) Log.d(RESUME_AUDIO_TAG, "resume audio procedure completed") - } else { Log.d(RESUME_AUDIO_TAG, "No voice message to restore") } @@ -2639,7 +2636,7 @@ class ChatActivity : voiceMessageToRestoreWasPlaying = false } - private fun getItemFromAdapter(messageId: String): Pair? { + private fun getItemFromAdapter(messageId: String): Pair? { if (adapter != null) { val messagePosition = adapter!!.items!!.indexOfFirst { it.item is ChatMessage && (it.item as ChatMessage).id == messageId @@ -2653,7 +2650,8 @@ class ChatActivity : } } else { Log.d( - TAG, "messagePosition is -1, adapter # of items: " + adapter!!.itemCount + TAG, + "messagePosition is -1, adapter # of items: " + adapter!!.itemCount ) } } else { @@ -2831,7 +2829,6 @@ class ChatActivity : while (chatMessageIterator.hasNext()) { val currentMessage = chatMessageIterator.next() - if (isInfoMessageAboutDeletion(currentMessage) || isReactionsMessage(currentMessage) || isPollVotedMessage(currentMessage) || @@ -3176,7 +3173,7 @@ class ChatActivity : val lon = data["longitude"]!! metaData = "{\"type\":\"geo-location\",\"id\":\"geo:$lat,$lon\",\"latitude\":\"$lat\"," + - "\"longitude\":\"$lon\",\"name\":\"$name\"}" + "\"longitude\":\"$lon\",\"name\":\"$name\"}" } when (type) { diff --git a/app/src/main/java/com/nextcloud/talk/chat/data/ChatMessageRepository.kt b/app/src/main/java/com/nextcloud/talk/chat/data/ChatMessageRepository.kt index 83f79ae5e70..049d86ba67b 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/data/ChatMessageRepository.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/data/ChatMessageRepository.kt @@ -32,11 +32,7 @@ interface ChatMessageRepository : LifecycleAwareManager { val lastCommonReadFlow: Flow - fun setData( - conversationModel: ConversationModel, - credentials: String, - urlForChatting: String - ) + fun setData(conversationModel: ConversationModel, credentials: String, urlForChatting: String) fun loadInitialMessages(withNetworkParams: Bundle): Job diff --git a/app/src/main/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepository.kt b/app/src/main/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepository.kt index fd3a4f4ab99..e635ecb38e5 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepository.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepository.kt @@ -90,11 +90,7 @@ class OfflineFirstChatRepository @Inject constructor( private lateinit var credentials: String private lateinit var urlForChatting: String - override fun setData( - conversationModel: ConversationModel, - credentials: String, - urlForChatting: String - ) { + override fun setData(conversationModel: ConversationModel, credentials: String, urlForChatting: String) { this.conversationModel = conversationModel this.credentials = credentials this.urlForChatting = urlForChatting @@ -213,9 +209,7 @@ class OfflineFirstChatRepository @Inject constructor( } } - private suspend fun hasToLoadPreviousMessagesFromServer( - beforeMessageId: Long - ): Boolean { + private suspend fun hasToLoadPreviousMessagesFromServer(beforeMessageId: Long): Boolean { val loadFromServer: Boolean val blockForMessage = getBlockOfMessage(beforeMessageId.toInt()) @@ -239,7 +233,8 @@ class OfflineFirstChatRepository @Inject constructor( loadFromServer = amountBetween < 100 Log.d( - TAG, "Amount between messageId " + beforeMessageId + " and " + blockForMessage.oldestMessageId + + TAG, + "Amount between messageId " + beforeMessageId + " and " + blockForMessage.oldestMessageId + " is: " + amountBetween + " so 'loadFromServer' is " + loadFromServer ) } @@ -272,9 +267,7 @@ class OfflineFirstChatRepository @Inject constructor( return fieldMap } - override suspend fun getMessage(messageId: Long, bundle: Bundle): - Flow { - + override suspend fun getMessage(messageId: Long, bundle: Bundle): Flow { Log.d(TAG, "Get message with id $messageId") val loadFromServer = hasToLoadPreviousMessagesFromServer(messageId) diff --git a/app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt b/app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt index 7f06b84cf4b..ca821d55ad4 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt @@ -217,11 +217,7 @@ class ChatViewModel @Inject constructor( val reactionDeletedViewState: LiveData get() = _reactionDeletedViewState - fun setData( - conversationModel: ConversationModel, - credentials: String, - urlForChatting: String - ) { + fun setData(conversationModel: ConversationModel, credentials: String, urlForChatting: String) { chatRepository.setData( conversationModel, credentials, diff --git a/app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt b/app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt index 66ec2502f43..1f938318587 100644 --- a/app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt @@ -121,7 +121,6 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_FORWARD_MSG_FLAG import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_FORWARD_MSG_TEXT import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_INTERNAL_USER_ID import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_NEW_CONVERSATION -import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ID import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_SHARED_TEXT import com.nextcloud.talk.utils.permissions.PlatformPermissionUtil diff --git a/app/src/main/java/com/nextcloud/talk/data/database/dao/ChatBlocksDao.kt b/app/src/main/java/com/nextcloud/talk/data/database/dao/ChatBlocksDao.kt index 171feb228fd..af93974d63e 100644 --- a/app/src/main/java/com/nextcloud/talk/data/database/dao/ChatBlocksDao.kt +++ b/app/src/main/java/com/nextcloud/talk/data/database/dao/ChatBlocksDao.kt @@ -57,7 +57,6 @@ interface ChatBlocksDao { ) fun getChatBlocksContainingMessageId(internalConversationId: String, messageId: Long): Flow> - @Query( """ SELECT * diff --git a/app/src/main/java/com/nextcloud/talk/data/database/mappers/ChatMessageMapUtils.kt b/app/src/main/java/com/nextcloud/talk/data/database/mappers/ChatMessageMapUtils.kt index 07ef49fbfd3..30b856a6bf1 100644 --- a/app/src/main/java/com/nextcloud/talk/data/database/mappers/ChatMessageMapUtils.kt +++ b/app/src/main/java/com/nextcloud/talk/data/database/mappers/ChatMessageMapUtils.kt @@ -10,8 +10,6 @@ package com.nextcloud.talk.data.database.mappers import com.nextcloud.talk.models.json.chat.ChatMessageJson import com.nextcloud.talk.data.database.model.ChatMessageEntity import com.nextcloud.talk.chat.data.model.ChatMessage -import com.nextcloud.talk.data.database.dao.ChatMessagesDao -import kotlinx.coroutines.flow.first fun ChatMessageJson.asEntity(accountId: Long) = ChatMessageEntity( diff --git a/app/src/main/java/com/nextcloud/talk/data/database/model/ChatMessageEntity.kt b/app/src/main/java/com/nextcloud/talk/data/database/model/ChatMessageEntity.kt index 817adda143e..dbf1cce924d 100644 --- a/app/src/main/java/com/nextcloud/talk/data/database/model/ChatMessageEntity.kt +++ b/app/src/main/java/com/nextcloud/talk/data/database/model/ChatMessageEntity.kt @@ -63,7 +63,7 @@ data class ChatMessageEntity( @ColumnInfo(name = "reactions") var reactions: LinkedHashMap? = null, @ColumnInfo(name = "reactionsSelf") var reactionsSelf: ArrayList? = null, @ColumnInfo(name = "systemMessage") var systemMessageType: ChatMessage.SystemMessageType, - @ColumnInfo(name = "timestamp") var timestamp: Long = 0, + @ColumnInfo(name = "timestamp") var timestamp: Long = 0 // missing/not needed: referenceId // missing/not needed: silent ) diff --git a/app/src/main/java/com/nextcloud/talk/data/database/model/ConversationEntity.kt b/app/src/main/java/com/nextcloud/talk/data/database/model/ConversationEntity.kt index 56d840c8ddb..1c0d067dec4 100644 --- a/app/src/main/java/com/nextcloud/talk/data/database/model/ConversationEntity.kt +++ b/app/src/main/java/com/nextcloud/talk/data/database/model/ConversationEntity.kt @@ -92,7 +92,7 @@ data class ConversationEntity( @ColumnInfo(name = "type") var type: ConversationEnums.ConversationType, @ColumnInfo(name = "unreadMention") var unreadMention: Boolean = false, @ColumnInfo(name = "unreadMentionDirect") var unreadMentionDirect: Boolean, - @ColumnInfo(name = "unreadMessages") var unreadMessages: Int = 0, + @ColumnInfo(name = "unreadMessages") var unreadMessages: Int = 0 // missing/not needed: attendeeId // missing/not needed: attendeePin // missing/not needed: attendeePermissions diff --git a/app/src/main/java/com/nextcloud/talk/data/source/local/TalkDatabase.kt b/app/src/main/java/com/nextcloud/talk/data/source/local/TalkDatabase.kt index 573e8122554..a0d053d901d 100644 --- a/app/src/main/java/com/nextcloud/talk/data/source/local/TalkDatabase.kt +++ b/app/src/main/java/com/nextcloud/talk/data/source/local/TalkDatabase.kt @@ -51,7 +51,7 @@ import java.util.Locale ], version = 11, autoMigrations = [ - AutoMigration(from = 9, to = 10), + AutoMigration(from = 9, to = 10) ], exportSchema = true ) diff --git a/app/src/main/java/com/nextcloud/talk/models/domain/ConversationModel.kt b/app/src/main/java/com/nextcloud/talk/models/domain/ConversationModel.kt index 2da0f9db467..6e361a71105 100644 --- a/app/src/main/java/com/nextcloud/talk/models/domain/ConversationModel.kt +++ b/app/src/main/java/com/nextcloud/talk/models/domain/ConversationModel.kt @@ -62,7 +62,7 @@ class ConversationModel( var remoteToken: String? = null, // attributes that don't come from API. This should be changed?! - var password: String? = null, + var password: String? = null ) { companion object { diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessageJson.kt b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessageJson.kt index 90068d94559..024e13fe651 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessageJson.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessageJson.kt @@ -42,5 +42,5 @@ data class ChatMessageJson( @JsonField(name = ["lastEditActorId"]) var lastEditActorId: String? = null, @JsonField(name = ["lastEditActorType"]) var lastEditActorType: String? = null, @JsonField(name = ["lastEditTimestamp"]) var lastEditTimestamp: Long? = 0, - @JsonField(name = ["deleted"]) var deleted: Boolean = false, + @JsonField(name = ["deleted"]) var deleted: Boolean = false ) : Parcelable diff --git a/app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.kt b/app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.kt index fae0225cae2..deb36a6e4a9 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.kt @@ -152,7 +152,7 @@ data class Conversation( var remoteServer: String? = null, @JsonField(name = ["remoteToken"]) - var remoteToken: String? = null, + var remoteToken: String? = null ) : Parcelable { @Deprecated("Use ConversationUtil") diff --git a/app/src/test/java/com/nextcloud/talk/contacts/ContactsViewModelTest.kt b/app/src/test/java/com/nextcloud/talk/contacts/ContactsViewModelTest.kt index 7bb905b4317..8a9a5693794 100644 --- a/app/src/test/java/com/nextcloud/talk/contacts/ContactsViewModelTest.kt +++ b/app/src/test/java/com/nextcloud/talk/contacts/ContactsViewModelTest.kt @@ -81,7 +81,7 @@ class ContactsViewModelTest { @Test fun `update shareTypes`() { - viewModel.updateShareTypes(ShareType.Group.shareType) + viewModel.updateShareTypes(listOf(ShareType.Group.shareType)) assert(viewModel.shareTypeList.contains(ShareType.Group.shareType)) }