mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-21 03:35:15 +01:00
Reformat
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
1a70d28acb
commit
dbf8d406f8
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
package com.nextcloud.talk.activities
|
package com.nextcloud.talk.activities
|
||||||
|
|
||||||
import android.content.Intent
|
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
@ -37,7 +36,6 @@ import com.nextcloud.talk.R
|
|||||||
import com.nextcloud.talk.controllers.CallController
|
import com.nextcloud.talk.controllers.CallController
|
||||||
import com.nextcloud.talk.controllers.CallNotificationController
|
import com.nextcloud.talk.controllers.CallNotificationController
|
||||||
import com.nextcloud.talk.events.ConfigurationChangeEvent
|
import com.nextcloud.talk.events.ConfigurationChangeEvent
|
||||||
import com.nextcloud.talk.newarch.services.CallService
|
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys
|
import com.nextcloud.talk.utils.bundle.BundleKeys
|
||||||
|
|
||||||
class MagicCallActivity : BaseActivity() {
|
class MagicCallActivity : BaseActivity() {
|
||||||
|
@ -59,6 +59,7 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
|||||||
|
|
||||||
@BindView(R.id.toolbar)
|
@BindView(R.id.toolbar)
|
||||||
lateinit var toolbar: MaterialToolbar
|
lateinit var toolbar: MaterialToolbar
|
||||||
|
|
||||||
@BindView(R.id.controller_container)
|
@BindView(R.id.controller_container)
|
||||||
lateinit var container: ViewGroup
|
lateinit var container: ViewGroup
|
||||||
|
|
||||||
@ -149,7 +150,7 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
|||||||
extras.putParcelable(BundleKeys.KEY_USER_ENTITY, it)
|
extras.putParcelable(BundleKeys.KEY_USER_ENTITY, it)
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
ConductorRemapping.remapChatController(
|
ConductorRemapping.remapChatController(
|
||||||
router!!, it.id!!,
|
router!!, it.id,
|
||||||
intent.getStringExtra(BundleKeys.KEY_CONVERSATION_TOKEN)!!, extras, false)
|
intent.getStringExtra(BundleKeys.KEY_CONVERSATION_TOKEN)!!, extras, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,18 +139,23 @@ class AdvancedUserItem(
|
|||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.participantNameTextView)
|
@BindView(R.id.participantNameTextView)
|
||||||
var contactDisplayName: EmojiTextView? = null
|
var contactDisplayName: EmojiTextView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.secondary_text)
|
@BindView(R.id.secondary_text)
|
||||||
var serverUrl: TextView? = null
|
var serverUrl: TextView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.avatar_image)
|
@BindView(R.id.avatar_image)
|
||||||
var avatarImageView: ImageView? = null
|
var avatarImageView: ImageView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.linear_layout)
|
@BindView(R.id.linear_layout)
|
||||||
var linearLayout: LinearLayout? = null
|
var linearLayout: LinearLayout? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.more_menu)
|
@BindView(R.id.more_menu)
|
||||||
var moreMenuButton: ImageButton? = null
|
var moreMenuButton: ImageButton? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.password_protected_image_view)
|
@BindView(R.id.password_protected_image_view)
|
||||||
var passwordProtectedImageView: ImageView? = null
|
var passwordProtectedImageView: ImageView? = null
|
||||||
|
@ -80,9 +80,11 @@ class NotificationSoundItem(
|
|||||||
@JvmField
|
@JvmField
|
||||||
@BindView(id.notificationNameTextView)
|
@BindView(id.notificationNameTextView)
|
||||||
var notificationName: TextView? = null
|
var notificationName: TextView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(id.imageView)
|
@BindView(id.imageView)
|
||||||
var imageView: ImageView? = null
|
var imageView: ImageView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(id.checkedImageView)
|
@BindView(id.checkedImageView)
|
||||||
var checkedImageView: ImageView? = null
|
var checkedImageView: ImageView? = null
|
||||||
|
@ -49,6 +49,7 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage
|
|||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.messageText)
|
@BindView(R.id.messageText)
|
||||||
var messageText: EmojiTextView? = null
|
var messageText: EmojiTextView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.messageTime)
|
@BindView(R.id.messageTime)
|
||||||
var messageTimeView: TextView? = null
|
var messageTimeView: TextView? = null
|
||||||
|
@ -53,7 +53,6 @@ import com.nextcloud.talk.newarch.features.contactsflow.di.module.ContactsFlowMo
|
|||||||
import com.nextcloud.talk.newarch.features.conversationslist.di.module.ConversationsListModule
|
import com.nextcloud.talk.newarch.features.conversationslist.di.module.ConversationsListModule
|
||||||
import com.nextcloud.talk.newarch.local.dao.UsersDao
|
import com.nextcloud.talk.newarch.local.dao.UsersDao
|
||||||
import com.nextcloud.talk.newarch.local.models.User
|
import com.nextcloud.talk.newarch.local.models.User
|
||||||
import com.nextcloud.talk.newarch.local.models.UserNgEntity
|
|
||||||
import com.nextcloud.talk.newarch.local.models.other.UserStatus.*
|
import com.nextcloud.talk.newarch.local.models.other.UserStatus.*
|
||||||
import com.nextcloud.talk.newarch.local.models.toUserEntity
|
import com.nextcloud.talk.newarch.local.models.toUserEntity
|
||||||
import com.nextcloud.talk.newarch.services.shortcuts.ShortcutService
|
import com.nextcloud.talk.newarch.services.shortcuts.ShortcutService
|
||||||
|
@ -153,18 +153,23 @@ class BrowserFileItem(
|
|||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.file_icon)
|
@BindView(R.id.file_icon)
|
||||||
var fileIconImageView: ImageView? = null
|
var fileIconImageView: ImageView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.fileModifiedTextView)
|
@BindView(R.id.fileModifiedTextView)
|
||||||
var fileModifiedTextView: TextView? = null
|
var fileModifiedTextView: TextView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.filenameTextView)
|
@BindView(R.id.filenameTextView)
|
||||||
var filenameTextView: TextView? = null
|
var filenameTextView: TextView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.selectFileCheckbox)
|
@BindView(R.id.selectFileCheckbox)
|
||||||
var selectFileCheckbox: CheckBox? = null
|
var selectFileCheckbox: CheckBox? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.fileEncryptedImageView)
|
@BindView(R.id.fileEncryptedImageView)
|
||||||
var fileEncryptedImageView: ImageView? = null
|
var fileEncryptedImageView: ImageView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.fileFavoriteImageView)
|
@BindView(R.id.fileFavoriteImageView)
|
||||||
var fileFavoriteImageView: ImageView? = null
|
var fileFavoriteImageView: ImageView? = null
|
||||||
|
@ -55,15 +55,19 @@ import java.util.*
|
|||||||
|
|
||||||
class BrowserController(args: Bundle) : BaseController(), ListingInterface, FlexibleAdapter.OnItemClickListener, SelectionInterface {
|
class BrowserController(args: Bundle) : BaseController(), ListingInterface, FlexibleAdapter.OnItemClickListener, SelectionInterface {
|
||||||
private val selectedPaths: MutableSet<String>
|
private val selectedPaths: MutableSet<String>
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.recyclerView)
|
@BindView(R.id.recyclerView)
|
||||||
internal var recyclerView: RecyclerView? = null
|
internal var recyclerView: RecyclerView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.fast_scroller)
|
@BindView(R.id.fast_scroller)
|
||||||
internal var fastScroller: FastScroller? = null
|
internal var fastScroller: FastScroller? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.action_back)
|
@BindView(R.id.action_back)
|
||||||
internal var backMenuItem: BottomNavigationItemView? = null
|
internal var backMenuItem: BottomNavigationItemView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.action_refresh)
|
@BindView(R.id.action_refresh)
|
||||||
internal var actionRefreshMenuItem: BottomNavigationItemView? = null
|
internal var actionRefreshMenuItem: BottomNavigationItemView? = null
|
||||||
@ -126,7 +130,7 @@ class BrowserController(args: Bundle) : BaseController(), ListingInterface, Flex
|
|||||||
iterator.remove()
|
iterator.remove()
|
||||||
if (paths.size == 10 || !iterator.hasNext()) {
|
if (paths.size == 10 || !iterator.hasNext()) {
|
||||||
data = Data.Builder()
|
data = Data.Builder()
|
||||||
.putLong(BundleKeys.KEY_INTERNAL_USER_ID, activeUser.id!!)
|
.putLong(BundleKeys.KEY_INTERNAL_USER_ID, activeUser.id)
|
||||||
.putString(BundleKeys.KEY_CONVERSATION_TOKEN, roomToken)
|
.putString(BundleKeys.KEY_CONVERSATION_TOKEN, roomToken)
|
||||||
.putStringArray(BundleKeys.KEY_FILE_PATHS, paths.toTypedArray())
|
.putStringArray(BundleKeys.KEY_FILE_PATHS, paths.toTypedArray())
|
||||||
.build()
|
.build()
|
||||||
|
@ -96,12 +96,15 @@ class CallController(args: Bundle) : BaseController() {
|
|||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.callControlEnableSpeaker)
|
@BindView(R.id.callControlEnableSpeaker)
|
||||||
var callControlEnableSpeaker: ImageView? = null
|
var callControlEnableSpeaker: ImageView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.pip_video_view)
|
@BindView(R.id.pip_video_view)
|
||||||
var pipVideoView: SurfaceViewRenderer? = null
|
var pipVideoView: SurfaceViewRenderer? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.relative_layout)
|
@BindView(R.id.relative_layout)
|
||||||
var relativeLayout: RelativeLayout? = null
|
var relativeLayout: RelativeLayout? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.remote_renderers_layout)
|
@BindView(R.id.remote_renderers_layout)
|
||||||
var remoteRenderersLayout: LinearLayout? = null
|
var remoteRenderersLayout: LinearLayout? = null
|
||||||
@ -109,15 +112,19 @@ class CallController(args: Bundle) : BaseController() {
|
|||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.callControlsRelativeLayout)
|
@BindView(R.id.callControlsRelativeLayout)
|
||||||
var callControls: RelativeLayout? = null
|
var callControls: RelativeLayout? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.call_control_microphone)
|
@BindView(R.id.call_control_microphone)
|
||||||
var microphoneControlButton: ImageView? = null
|
var microphoneControlButton: ImageView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.call_control_camera)
|
@BindView(R.id.call_control_camera)
|
||||||
var cameraControlButton: ImageView? = null
|
var cameraControlButton: ImageView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.call_control_switch_camera)
|
@BindView(R.id.call_control_switch_camera)
|
||||||
var cameraSwitchButton: ImageView? = null
|
var cameraSwitchButton: ImageView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.connectingTextView)
|
@BindView(R.id.connectingTextView)
|
||||||
var connectingTextView: TextView? = null
|
var connectingTextView: TextView? = null
|
||||||
|
@ -26,10 +26,7 @@ import android.graphics.Bitmap
|
|||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.drawable.BitmapDrawable
|
import android.graphics.drawable.BitmapDrawable
|
||||||
import android.graphics.drawable.ColorDrawable
|
import android.graphics.drawable.ColorDrawable
|
||||||
import android.media.MediaPlayer
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Handler
|
|
||||||
import android.os.Vibrator
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
@ -53,19 +50,12 @@ import com.nextcloud.talk.controllers.base.BaseController
|
|||||||
import com.nextcloud.talk.events.CallEvent
|
import com.nextcloud.talk.events.CallEvent
|
||||||
import com.nextcloud.talk.events.ConfigurationChangeEvent
|
import com.nextcloud.talk.events.ConfigurationChangeEvent
|
||||||
import com.nextcloud.talk.models.json.conversations.Conversation
|
import com.nextcloud.talk.models.json.conversations.Conversation
|
||||||
import com.nextcloud.talk.models.json.participants.Participant
|
|
||||||
import com.nextcloud.talk.models.json.participants.ParticipantsOverall
|
|
||||||
import com.nextcloud.talk.newarch.local.models.UserNgEntity
|
import com.nextcloud.talk.newarch.local.models.UserNgEntity
|
||||||
import com.nextcloud.talk.newarch.local.models.getCredentials
|
import com.nextcloud.talk.newarch.local.models.getCredentials
|
||||||
import com.nextcloud.talk.newarch.services.CallService
|
import com.nextcloud.talk.newarch.services.CallService
|
||||||
import com.nextcloud.talk.utils.ApiUtils
|
import com.nextcloud.talk.utils.ApiUtils
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys
|
import com.nextcloud.talk.utils.bundle.BundleKeys
|
||||||
import com.nextcloud.talk.utils.database.arbitrarystorage.ArbitraryStorageUtils
|
|
||||||
import com.nextcloud.talk.utils.singletons.AvatarStatusCodeHolder
|
import com.nextcloud.talk.utils.singletons.AvatarStatusCodeHolder
|
||||||
import com.uber.autodispose.AutoDispose
|
|
||||||
import io.reactivex.Observer
|
|
||||||
import io.reactivex.disposables.Disposable
|
|
||||||
import io.reactivex.schedulers.Schedulers
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.GlobalScope
|
import kotlinx.coroutines.GlobalScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@ -130,6 +120,7 @@ class CallNotificationController(private val originalBundle: Bundle) : BaseContr
|
|||||||
hideIncomingCallNotificationIntent.putExtra(BundleKeys.KEY_ACTIVE_NOTIFICATION, activeNotification)
|
hideIncomingCallNotificationIntent.putExtra(BundleKeys.KEY_ACTIVE_NOTIFICATION, activeNotification)
|
||||||
applicationContext?.startService(hideIncomingCallNotificationIntent)
|
applicationContext?.startService(hideIncomingCallNotificationIntent)
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnClick(R.id.callControlHangupView)
|
@OnClick(R.id.callControlHangupView)
|
||||||
internal fun hangup() {
|
internal fun hangup() {
|
||||||
dismissIncomingCallNotification()
|
dismissIncomingCallNotification()
|
||||||
|
@ -113,27 +113,35 @@ class ChatController(args: Bundle) : BaseController(), MessagesListAdapter
|
|||||||
@BindView(R.id.messagesListView)
|
@BindView(R.id.messagesListView)
|
||||||
@JvmField
|
@JvmField
|
||||||
var messagesListView: MessagesList? = null
|
var messagesListView: MessagesList? = null
|
||||||
|
|
||||||
@BindView(R.id.messageInputView)
|
@BindView(R.id.messageInputView)
|
||||||
@JvmField
|
@JvmField
|
||||||
var messageInputView: MessageInput? = null
|
var messageInputView: MessageInput? = null
|
||||||
|
|
||||||
@BindView(R.id.messageInput)
|
@BindView(R.id.messageInput)
|
||||||
@JvmField
|
@JvmField
|
||||||
var messageInput: EmojiEditText? = null
|
var messageInput: EmojiEditText? = null
|
||||||
|
|
||||||
@BindView(R.id.popupBubbleView)
|
@BindView(R.id.popupBubbleView)
|
||||||
@JvmField
|
@JvmField
|
||||||
var popupBubble: PopupBubble? = null
|
var popupBubble: PopupBubble? = null
|
||||||
|
|
||||||
@BindView(R.id.progressBar)
|
@BindView(R.id.progressBar)
|
||||||
@JvmField
|
@JvmField
|
||||||
var loadingProgressBar: ProgressBar? = null
|
var loadingProgressBar: ProgressBar? = null
|
||||||
|
|
||||||
@BindView(R.id.smileyButton)
|
@BindView(R.id.smileyButton)
|
||||||
@JvmField
|
@JvmField
|
||||||
var smileyButton: ImageButton? = null
|
var smileyButton: ImageButton? = null
|
||||||
|
|
||||||
@BindView(R.id.lobbyView)
|
@BindView(R.id.lobbyView)
|
||||||
@JvmField
|
@JvmField
|
||||||
var lobbyView: RelativeLayout? = null
|
var lobbyView: RelativeLayout? = null
|
||||||
|
|
||||||
@BindView(R.id.lobbyTextView)
|
@BindView(R.id.lobbyTextView)
|
||||||
@JvmField
|
@JvmField
|
||||||
var conversationLobbyText: TextView? = null
|
var conversationLobbyText: TextView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.quotedChatMessageView)
|
@BindView(R.id.quotedChatMessageView)
|
||||||
var quotedChatMessageView: RelativeLayout? = null
|
var quotedChatMessageView: RelativeLayout? = null
|
||||||
@ -986,11 +994,11 @@ class ChatController(args: Bundle) : BaseController(), MessagesListAdapter
|
|||||||
private fun setupWebsocket() {
|
private fun setupWebsocket() {
|
||||||
if (conversationUser != null) {
|
if (conversationUser != null) {
|
||||||
if (WebSocketConnectionHelper.getMagicWebSocketInstanceForUserId(
|
if (WebSocketConnectionHelper.getMagicWebSocketInstanceForUserId(
|
||||||
conversationUser.id!!
|
conversationUser.id
|
||||||
) != null
|
) != null
|
||||||
) {
|
) {
|
||||||
magicWebSocketInstance =
|
magicWebSocketInstance =
|
||||||
WebSocketConnectionHelper.getMagicWebSocketInstanceForUserId(conversationUser.id!!)
|
WebSocketConnectionHelper.getMagicWebSocketInstanceForUserId(conversationUser.id)
|
||||||
} else {
|
} else {
|
||||||
magicWebSocketInstance = null
|
magicWebSocketInstance = null
|
||||||
}
|
}
|
||||||
@ -1512,7 +1520,7 @@ class ChatController(args: Bundle) : BaseController(), MessagesListAdapter
|
|||||||
null && conversationOverall.ocs.data.token != null
|
null && conversationOverall.ocs.data.token != null
|
||||||
) {
|
) {
|
||||||
ConductorRemapping.remapChatController(
|
ConductorRemapping.remapChatController(
|
||||||
router, conversationUser.id!!,
|
router, conversationUser.id,
|
||||||
conversationOverall.ocs.data.token!!, bundle, false
|
conversationOverall.ocs.data.token!!, bundle, false
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -117,46 +117,67 @@ class ConversationInfoController(args: Bundle) : BaseController(),
|
|||||||
|
|
||||||
@BindView(R.id.notification_settings)
|
@BindView(R.id.notification_settings)
|
||||||
lateinit var notificationsPreferenceScreen: MaterialPreferenceScreen
|
lateinit var notificationsPreferenceScreen: MaterialPreferenceScreen
|
||||||
|
|
||||||
@BindView(R.id.progressBar)
|
@BindView(R.id.progressBar)
|
||||||
lateinit var progressBar: ProgressBar
|
lateinit var progressBar: ProgressBar
|
||||||
|
|
||||||
@BindView(R.id.conversation_info_message_notifications)
|
@BindView(R.id.conversation_info_message_notifications)
|
||||||
lateinit var messageNotificationLevel: MaterialChoicePreference
|
lateinit var messageNotificationLevel: MaterialChoicePreference
|
||||||
|
|
||||||
@BindView(R.id.webinar_settings)
|
@BindView(R.id.webinar_settings)
|
||||||
lateinit var conversationInfoWebinar: MaterialPreferenceScreen
|
lateinit var conversationInfoWebinar: MaterialPreferenceScreen
|
||||||
|
|
||||||
@BindView(R.id.conversation_info_lobby)
|
@BindView(R.id.conversation_info_lobby)
|
||||||
lateinit var conversationInfoLobby: MaterialSwitchPreference
|
lateinit var conversationInfoLobby: MaterialSwitchPreference
|
||||||
|
|
||||||
@BindView(R.id.conversation_info_name)
|
@BindView(R.id.conversation_info_name)
|
||||||
lateinit var nameCategoryView: MaterialPreferenceCategory
|
lateinit var nameCategoryView: MaterialPreferenceCategory
|
||||||
|
|
||||||
@BindView(R.id.start_time_preferences)
|
@BindView(R.id.start_time_preferences)
|
||||||
lateinit var startTimeView: MaterialStandardPreference
|
lateinit var startTimeView: MaterialStandardPreference
|
||||||
|
|
||||||
@BindView(R.id.avatar_image)
|
@BindView(R.id.avatar_image)
|
||||||
lateinit var conversationAvatarImageView: ImageView
|
lateinit var conversationAvatarImageView: ImageView
|
||||||
|
|
||||||
@BindView(R.id.display_name_text)
|
@BindView(R.id.display_name_text)
|
||||||
lateinit var conversationDisplayName: EmojiTextView
|
lateinit var conversationDisplayName: EmojiTextView
|
||||||
|
|
||||||
@BindView(R.id.participants_list_category)
|
@BindView(R.id.participants_list_category)
|
||||||
lateinit var participantsListCategory: MaterialPreferenceCategoryWithRightLink
|
lateinit var participantsListCategory: MaterialPreferenceCategoryWithRightLink
|
||||||
|
|
||||||
@BindView(R.id.recyclerView)
|
@BindView(R.id.recyclerView)
|
||||||
lateinit var recyclerView: RecyclerView
|
lateinit var recyclerView: RecyclerView
|
||||||
|
|
||||||
@BindView(R.id.deleteConversationAction)
|
@BindView(R.id.deleteConversationAction)
|
||||||
lateinit var deleteConversationAction: MaterialStandardPreference
|
lateinit var deleteConversationAction: MaterialStandardPreference
|
||||||
|
|
||||||
@BindView(R.id.leaveConversationAction)
|
@BindView(R.id.leaveConversationAction)
|
||||||
lateinit var leaveConversationAction: MaterialStandardPreference
|
lateinit var leaveConversationAction: MaterialStandardPreference
|
||||||
|
|
||||||
@BindView(R.id.ownOptions)
|
@BindView(R.id.ownOptions)
|
||||||
lateinit var ownOptionsCategory: MaterialPreferenceCategory
|
lateinit var ownOptionsCategory: MaterialPreferenceCategory
|
||||||
|
|
||||||
@BindView(R.id.muteCalls)
|
@BindView(R.id.muteCalls)
|
||||||
lateinit var muteCalls: MaterialSwitchPreference
|
lateinit var muteCalls: MaterialSwitchPreference
|
||||||
|
|
||||||
@BindView(R.id.mpc_action)
|
@BindView(R.id.mpc_action)
|
||||||
lateinit var actionTextView: TextView
|
lateinit var actionTextView: TextView
|
||||||
|
|
||||||
@BindView(R.id.generalConversationOptions)
|
@BindView(R.id.generalConversationOptions)
|
||||||
lateinit var generalConversationOptions: MaterialPreferenceScreen
|
lateinit var generalConversationOptions: MaterialPreferenceScreen
|
||||||
|
|
||||||
@BindView(R.id.changeConversationName)
|
@BindView(R.id.changeConversationName)
|
||||||
lateinit var changeConversationName: MaterialEditTextPreference
|
lateinit var changeConversationName: MaterialEditTextPreference
|
||||||
|
|
||||||
@BindView(R.id.favoriteConversationAction)
|
@BindView(R.id.favoriteConversationAction)
|
||||||
lateinit var favoriteConversationAction: MaterialSwitchPreference
|
lateinit var favoriteConversationAction: MaterialSwitchPreference
|
||||||
|
|
||||||
@BindView(R.id.allowGuestsAction)
|
@BindView(R.id.allowGuestsAction)
|
||||||
lateinit var allowGuestsAction: MaterialSwitchPreference
|
lateinit var allowGuestsAction: MaterialSwitchPreference
|
||||||
|
|
||||||
@BindView(R.id.passwordAction)
|
@BindView(R.id.passwordAction)
|
||||||
lateinit var passwordAction: MaterialEditTextPreference
|
lateinit var passwordAction: MaterialEditTextPreference
|
||||||
|
|
||||||
@BindView(R.id.shareAction)
|
@BindView(R.id.shareAction)
|
||||||
lateinit var shareAction: MaterialStandardPreference
|
lateinit var shareAction: MaterialStandardPreference
|
||||||
|
|
||||||
@ -181,7 +202,7 @@ class ConversationInfoController(args: Bundle) : BaseController(),
|
|||||||
if (!TextUtils.isEmpty(conversationToken) && conversationUser != null) {
|
if (!TextUtils.isEmpty(conversationToken) && conversationUser != null) {
|
||||||
val data = Data.Builder()
|
val data = Data.Builder()
|
||||||
data.putString(BundleKeys.KEY_CONVERSATION_TOKEN, conversationToken)
|
data.putString(BundleKeys.KEY_CONVERSATION_TOKEN, conversationToken)
|
||||||
data.putLong(BundleKeys.KEY_INTERNAL_USER_ID, conversationUser.id!!)
|
data.putLong(BundleKeys.KEY_INTERNAL_USER_ID, conversationUser.id)
|
||||||
return data.build()
|
return data.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,72 +87,95 @@ class SettingsController : BaseController() {
|
|||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_screen)
|
@BindView(R.id.settings_screen)
|
||||||
var settingsScreen: MaterialPreferenceScreen? = null
|
var settingsScreen: MaterialPreferenceScreen? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_proxy_choice)
|
@BindView(R.id.settings_proxy_choice)
|
||||||
var proxyChoice: MaterialChoicePreference? = null
|
var proxyChoice: MaterialChoicePreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_proxy_port_edit)
|
@BindView(R.id.settings_proxy_port_edit)
|
||||||
var proxyPortEditText: MaterialEditTextPreference? = null
|
var proxyPortEditText: MaterialEditTextPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_licence)
|
@BindView(R.id.settings_licence)
|
||||||
var licenceButton: MaterialStandardPreference? = null
|
var licenceButton: MaterialStandardPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_privacy)
|
@BindView(R.id.settings_privacy)
|
||||||
var privacyButton: MaterialStandardPreference? = null
|
var privacyButton: MaterialStandardPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_source_code)
|
@BindView(R.id.settings_source_code)
|
||||||
var sourceCodeButton: MaterialStandardPreference? = null
|
var sourceCodeButton: MaterialStandardPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_version)
|
@BindView(R.id.settings_version)
|
||||||
var versionInfo: MaterialStandardPreference? = null
|
var versionInfo: MaterialStandardPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.avatar_image)
|
@BindView(R.id.avatar_image)
|
||||||
var avatarImageView: ImageView? = null
|
var avatarImageView: ImageView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.display_name_text)
|
@BindView(R.id.display_name_text)
|
||||||
var displayNameTextView: EmojiTextView? = null
|
var displayNameTextView: EmojiTextView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.base_url_text)
|
@BindView(R.id.base_url_text)
|
||||||
var baseUrlTextView: TextView? = null
|
var baseUrlTextView: TextView? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_call_sound)
|
@BindView(R.id.settings_call_sound)
|
||||||
var settingsCallSound: MaterialStandardPreference? = null
|
var settingsCallSound: MaterialStandardPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_message_sound)
|
@BindView(R.id.settings_message_sound)
|
||||||
var settingsMessageSound: MaterialStandardPreference? = null
|
var settingsMessageSound: MaterialStandardPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_remove_account)
|
@BindView(R.id.settings_remove_account)
|
||||||
var removeAccountButton: MaterialStandardPreference? = null
|
var removeAccountButton: MaterialStandardPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_switch)
|
@BindView(R.id.settings_switch)
|
||||||
var switchAccountButton: MaterialStandardPreference? = null
|
var switchAccountButton: MaterialStandardPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_reauthorize)
|
@BindView(R.id.settings_reauthorize)
|
||||||
var reauthorizeButton: MaterialStandardPreference? = null
|
var reauthorizeButton: MaterialStandardPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_add_account)
|
@BindView(R.id.settings_add_account)
|
||||||
var addAccountButton: MaterialStandardPreference? = null
|
var addAccountButton: MaterialStandardPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.message_view)
|
@BindView(R.id.message_view)
|
||||||
var messageView: MaterialPreferenceCategory? = null
|
var messageView: MaterialPreferenceCategory? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_client_cert)
|
@BindView(R.id.settings_client_cert)
|
||||||
var certificateSetup: MaterialStandardPreference? = null
|
var certificateSetup: MaterialStandardPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_always_vibrate)
|
@BindView(R.id.settings_always_vibrate)
|
||||||
var shouldVibrateSwitchPreference: MaterialSwitchPreference? = null
|
var shouldVibrateSwitchPreference: MaterialSwitchPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_incognito_keyboard)
|
@BindView(R.id.settings_incognito_keyboard)
|
||||||
var incognitoKeyboardSwitchPreference: MaterialSwitchPreference? = null
|
var incognitoKeyboardSwitchPreference: MaterialSwitchPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_screen_security)
|
@BindView(R.id.settings_screen_security)
|
||||||
var screenSecuritySwitchPreference: MaterialSwitchPreference? = null
|
var screenSecuritySwitchPreference: MaterialSwitchPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_link_previews)
|
@BindView(R.id.settings_link_previews)
|
||||||
var linkPreviewsSwitchPreference: MaterialSwitchPreference? = null
|
var linkPreviewsSwitchPreference: MaterialSwitchPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_screen_lock)
|
@BindView(R.id.settings_screen_lock)
|
||||||
var screenLockSwitchPreference: MaterialSwitchPreference? = null
|
var screenLockSwitchPreference: MaterialSwitchPreference? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@BindView(R.id.settings_screen_lock_timeout)
|
@BindView(R.id.settings_screen_lock_timeout)
|
||||||
var screenLockTimeoutChoicePreference: MaterialChoicePreference? = null
|
var screenLockTimeoutChoicePreference: MaterialChoicePreference? = null
|
||||||
@ -442,7 +465,7 @@ class SettingsController : BaseController() {
|
|||||||
realAlias = ""
|
realAlias = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
currentUser = usersRepository.getUserWithId(currentUser!!.id!!)
|
currentUser = usersRepository.getUserWithId(currentUser!!.id)
|
||||||
currentUser!!.clientCertificate = realAlias
|
currentUser!!.clientCertificate = realAlias
|
||||||
GlobalScope.launch {
|
GlobalScope.launch {
|
||||||
usersRepository.updateUser(currentUser!!)
|
usersRepository.updateUser(currentUser!!)
|
||||||
@ -590,7 +613,7 @@ class SettingsController : BaseController() {
|
|||||||
var displayName: String? = userProfileOverall.ocs.data.displayName
|
var displayName: String? = userProfileOverall.ocs.data.displayName
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(displayName) && displayName != currentUser!!.displayName) {
|
if (!TextUtils.isEmpty(displayName) && displayName != currentUser!!.displayName) {
|
||||||
val user = usersRepository.getUserWithId(currentUser!!.id!!)
|
val user = usersRepository.getUserWithId(currentUser!!.id)
|
||||||
user.displayName = displayName
|
user.displayName = displayName
|
||||||
GlobalScope.launch {
|
GlobalScope.launch {
|
||||||
usersRepository.updateUser(user)
|
usersRepository.updateUser(user)
|
||||||
|
@ -82,7 +82,7 @@ class SwitchAccountController : BaseController {
|
|||||||
if (userItems.size > position) {
|
if (userItems.size > position) {
|
||||||
val userEntity = (userItems[position] as AdvancedUserItem).entity
|
val userEntity = (userItems[position] as AdvancedUserItem).entity
|
||||||
GlobalScope.launch {
|
GlobalScope.launch {
|
||||||
usersRepository.setUserAsActiveWithId(userEntity!!.id!!)
|
usersRepository.setUserAsActiveWithId(userEntity!!.id)
|
||||||
cookieManager.cookieStore.removeAll()
|
cookieManager.cookieStore.removeAll()
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
router.popCurrentController()
|
router.popCurrentController()
|
||||||
|
@ -45,7 +45,6 @@ import com.nextcloud.talk.R
|
|||||||
import com.nextcloud.talk.activities.MainActivity
|
import com.nextcloud.talk.activities.MainActivity
|
||||||
import com.nextcloud.talk.controllers.SwitchAccountController
|
import com.nextcloud.talk.controllers.SwitchAccountController
|
||||||
import com.nextcloud.talk.controllers.base.providers.ActionBarProvider
|
import com.nextcloud.talk.controllers.base.providers.ActionBarProvider
|
||||||
import com.nextcloud.talk.newarch.utils.dp
|
|
||||||
import com.nextcloud.talk.newarch.utils.px
|
import com.nextcloud.talk.newarch.utils.px
|
||||||
import com.nextcloud.talk.utils.preferences.AppPreferences
|
import com.nextcloud.talk.utils.preferences.AppPreferences
|
||||||
import com.uber.autodispose.lifecycle.LifecycleScopeProvider
|
import com.uber.autodispose.lifecycle.LifecycleScopeProvider
|
||||||
|
@ -77,7 +77,7 @@ class AccountRemovalWorker(context: Context, workerParams: WorkerParameters) : C
|
|||||||
})
|
})
|
||||||
} ?: run {
|
} ?: run {
|
||||||
runBlocking {
|
runBlocking {
|
||||||
usersRepository.deleteUserWithId(userEntity.id!!)
|
usersRepository.deleteUserWithId(userEntity.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ class AccountRemovalWorker(context: Context, workerParams: WorkerParameters) : C
|
|||||||
//deleteExternalSignalingInstanceForUserEntity(
|
//deleteExternalSignalingInstanceForUserEntity(
|
||||||
// userEntity.id!!)
|
// userEntity.id!!)
|
||||||
runBlocking {
|
runBlocking {
|
||||||
usersRepository.deleteUserWithId(userEntity.id!!)
|
usersRepository.deleteUserWithId(userEntity.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ class CapabilitiesWorker(context: Context, workerParams: WorkerParameters) : Cor
|
|||||||
internalUserEntity.capabilities = capabilitiesOverall.ocs.data.capabilities
|
internalUserEntity.capabilities = capabilitiesOverall.ocs.data.capabilities
|
||||||
runBlocking {
|
runBlocking {
|
||||||
val result = usersRepository.updateUser(internalUserEntity)
|
val result = usersRepository.updateUser(internalUserEntity)
|
||||||
eventBus.post(EventStatus(internalUserEntity.id!!,
|
eventBus.post(EventStatus(internalUserEntity.id,
|
||||||
EventStatus.EventType.CAPABILITIES_FETCH, result > 0))
|
EventStatus.EventType.CAPABILITIES_FETCH, result > 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ class CapabilitiesWorker(context: Context, workerParams: WorkerParameters) : Cor
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
eventBus.post(EventStatus(userEntityObject.id!!,
|
eventBus.post(EventStatus(userEntityObject.id,
|
||||||
EventStatus.EventType.CAPABILITIES_FETCH, false))
|
EventStatus.EventType.CAPABILITIES_FETCH, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class DeleteConversationWorker(context: Context,
|
|||||||
operationUser?.let {
|
operationUser?.let {
|
||||||
val credentials = it.getCredentials()
|
val credentials = it.getCredentials()
|
||||||
ncApi = retrofit.newBuilder().client(okHttpClient.newBuilder().cookieJar(JavaNetCookieJar(CookieManager())).build()).build().create(NcApi::class.java)
|
ncApi = retrofit.newBuilder().client(okHttpClient.newBuilder().cookieJar(JavaNetCookieJar(CookieManager())).build()).build().create(NcApi::class.java)
|
||||||
val eventStatus = EventStatus(it.id!!,
|
val eventStatus = EventStatus(it.id,
|
||||||
EventStatus.EventType.CONVERSATION_UPDATE, true)
|
EventStatus.EventType.CONVERSATION_UPDATE, true)
|
||||||
ncApi!!.deleteRoom(credentials, ApiUtils.getRoom(it.baseUrl, conversationToken))
|
ncApi!!.deleteRoom(credentials, ApiUtils.getRoom(it.baseUrl, conversationToken))
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
|
@ -56,7 +56,7 @@ class LeaveConversationWorker(context: Context, workerParams: WorkerParameters)
|
|||||||
if (operationUser != null) {
|
if (operationUser != null) {
|
||||||
val credentials = operationUser.getCredentials()
|
val credentials = operationUser.getCredentials()
|
||||||
ncApi = retrofit.newBuilder().client(okHttpClient.newBuilder().cookieJar(JavaNetCookieJar(CookieManager())).build()).build().create(NcApi::class.java)
|
ncApi = retrofit.newBuilder().client(okHttpClient.newBuilder().cookieJar(JavaNetCookieJar(CookieManager())).build()).build().create(NcApi::class.java)
|
||||||
val eventStatus = EventStatus(operationUser.id!!,
|
val eventStatus = EventStatus(operationUser.id,
|
||||||
EventStatus.EventType.CONVERSATION_UPDATE, true)
|
EventStatus.EventType.CONVERSATION_UPDATE, true)
|
||||||
ncApi!!.removeSelfFromRoom(credentials,
|
ncApi!!.removeSelfFromRoom(credentials,
|
||||||
ApiUtils.getUrlForRemoveSelfFromRoom(operationUser.baseUrl, conversationToken))
|
ApiUtils.getUrlForRemoveSelfFromRoom(operationUser.baseUrl, conversationToken))
|
||||||
|
@ -249,7 +249,7 @@ class MessageNotificationWorker(
|
|||||||
var notificationId = decryptedPushMessage.timestamp.toInt()
|
var notificationId = decryptedPushMessage.timestamp.toInt()
|
||||||
|
|
||||||
val notificationInfoBundle = Bundle()
|
val notificationInfoBundle = Bundle()
|
||||||
notificationInfoBundle.putLong(BundleKeys.KEY_INTERNAL_USER_ID, signatureVerification.userEntity!!.id!!)
|
notificationInfoBundle.putLong(BundleKeys.KEY_INTERNAL_USER_ID, signatureVerification.userEntity!!.id)
|
||||||
notificationInfoBundle.putString(BundleKeys.KEY_CONVERSATION_TOKEN, decryptedPushMessage.id)
|
notificationInfoBundle.putString(BundleKeys.KEY_CONVERSATION_TOKEN, decryptedPushMessage.id)
|
||||||
notificationInfoBundle.putLong(BundleKeys.KEY_NOTIFICATION_ID, decryptedPushMessage.notificationId!!)
|
notificationInfoBundle.putLong(BundleKeys.KEY_NOTIFICATION_ID, decryptedPushMessage.notificationId!!)
|
||||||
notificationBuilder.extras = notificationInfoBundle
|
notificationBuilder.extras = notificationInfoBundle
|
||||||
|
@ -70,18 +70,18 @@ class SignalingSettingsWorker(context: Context, workerParams: WorkerParameters)
|
|||||||
externalSignalingServer = ExternalSignalingServer()
|
externalSignalingServer = ExternalSignalingServer()
|
||||||
externalSignalingServer.externalSignalingServer = signalingSettingsOverall.ocs.signalingSettings.externalSignalingServer
|
externalSignalingServer.externalSignalingServer = signalingSettingsOverall.ocs.signalingSettings.externalSignalingServer
|
||||||
externalSignalingServer.externalSignalingTicket = signalingSettingsOverall.ocs.signalingSettings.externalSignalingTicket
|
externalSignalingServer.externalSignalingTicket = signalingSettingsOverall.ocs.signalingSettings.externalSignalingTicket
|
||||||
val user = usersRepository.getUserWithId(userEntity.id!!)
|
val user = usersRepository.getUserWithId(userEntity.id)
|
||||||
//user.externalSignaling = externalSignalingServer
|
//user.externalSignaling = externalSignalingServer
|
||||||
runBlocking {
|
runBlocking {
|
||||||
val result = usersRepository.updateUser(user)
|
val result = usersRepository.updateUser(user)
|
||||||
eventBus.post(EventStatus(user.id!!,
|
eventBus.post(EventStatus(user.id,
|
||||||
EventStatus.EventType.SIGNALING_SETTINGS, result > 0))
|
EventStatus.EventType.SIGNALING_SETTINGS, result > 0))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
eventBus.post(EventStatus(finalUserEntity!!.id!!,
|
eventBus.post(EventStatus(finalUserEntity!!.id,
|
||||||
EventStatus.EventType.SIGNALING_SETTINGS, false))
|
EventStatus.EventType.SIGNALING_SETTINGS, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,66 +47,84 @@ class ChatMessage : IMessage, MessageContentType, MessageContentType.Image {
|
|||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Ignore
|
@Ignore
|
||||||
var grouped = false
|
var grouped = false
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Ignore
|
@Ignore
|
||||||
var oneToOneConversation = false
|
var oneToOneConversation = false
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Ignore
|
@Ignore
|
||||||
var activeUser: UserNgEntity? = null
|
var activeUser: UserNgEntity? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Ignore
|
@Ignore
|
||||||
var selectedIndividualHashMap: Map<String, String>? = null
|
var selectedIndividualHashMap: Map<String, String>? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Ignore
|
@Ignore
|
||||||
var isLinkPreviewAllowed = false
|
var isLinkPreviewAllowed = false
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
var internalMessageId: String? = null
|
var internalMessageId: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
var internalConversationId: String? = null
|
var internalConversationId: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["id"])
|
@JsonField(name = ["id"])
|
||||||
@Ignore
|
@Ignore
|
||||||
var jsonMessageId: Long? = null
|
var jsonMessageId: Long? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["token"])
|
@JsonField(name = ["token"])
|
||||||
var token: String? = null
|
var token: String? = null
|
||||||
|
|
||||||
// guests or users
|
// guests or users
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["actorType"])
|
@JsonField(name = ["actorType"])
|
||||||
var actorType: String? = null
|
var actorType: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["actorId"])
|
@JsonField(name = ["actorId"])
|
||||||
var actorId: String? = null
|
var actorId: String? = null
|
||||||
|
|
||||||
// send when crafting a message
|
// send when crafting a message
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["actorDisplayName"])
|
@JsonField(name = ["actorDisplayName"])
|
||||||
var actorDisplayName: String? = null
|
var actorDisplayName: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["timestamp"])
|
@JsonField(name = ["timestamp"])
|
||||||
var timestamp: Long = 0
|
var timestamp: Long = 0
|
||||||
|
|
||||||
// send when crafting a message, max 1000 lines
|
// send when crafting a message, max 1000 lines
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["message"])
|
@JsonField(name = ["message"])
|
||||||
var message: String? = null
|
var message: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["messageParameters"])
|
@JsonField(name = ["messageParameters"])
|
||||||
@Ignore
|
@Ignore
|
||||||
var messageParameters: HashMap<String, HashMap<String, String>>? = null
|
var messageParameters: HashMap<String, HashMap<String, String>>? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["systemMessage"], typeConverter = EnumSystemMessageTypeConverter::class)
|
@JsonField(name = ["systemMessage"], typeConverter = EnumSystemMessageTypeConverter::class)
|
||||||
var systemMessageType: SystemMessageType? = null
|
var systemMessageType: SystemMessageType? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["isReplyable"])
|
@JsonField(name = ["isReplyable"])
|
||||||
var replyable = false
|
var replyable = false
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["parent"])
|
@JsonField(name = ["parent"])
|
||||||
var parentMessage: ChatMessage? = null
|
var parentMessage: ChatMessage? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Ignore
|
@Ignore
|
||||||
|
@ -43,68 +43,95 @@ import java.util.*
|
|||||||
class Conversation {
|
class Conversation {
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
var databaseId: String? = null
|
var databaseId: String? = null
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@NonNull
|
@NonNull
|
||||||
var databaseUserId: Long? = null
|
var databaseUserId: Long? = null
|
||||||
|
|
||||||
@JsonField(name = ["id"])
|
@JsonField(name = ["id"])
|
||||||
var conversationId: String? = null
|
var conversationId: String? = null
|
||||||
|
|
||||||
@JsonField(name = ["token"])
|
@JsonField(name = ["token"])
|
||||||
var token: String? = null
|
var token: String? = null
|
||||||
|
|
||||||
@JsonField(name = ["name"])
|
@JsonField(name = ["name"])
|
||||||
var name: String? = null
|
var name: String? = null
|
||||||
|
|
||||||
@JsonField(name = ["displayName"])
|
@JsonField(name = ["displayName"])
|
||||||
var displayName: String? = null
|
var displayName: String? = null
|
||||||
|
|
||||||
@JsonField(name = ["type"], typeConverter = EnumRoomTypeConverter::class)
|
@JsonField(name = ["type"], typeConverter = EnumRoomTypeConverter::class)
|
||||||
var type: ConversationType? = null
|
var type: ConversationType? = null
|
||||||
|
|
||||||
@JsonField(name = ["count"])
|
@JsonField(name = ["count"])
|
||||||
var count: Long = 0
|
var count: Long = 0
|
||||||
|
|
||||||
/*@JsonField(name = ["lastPing"])
|
/*@JsonField(name = ["lastPing"])
|
||||||
var lastPing: Long = 0*/
|
var lastPing: Long = 0*/
|
||||||
@JsonField(name = ["numGuests"])
|
@JsonField(name = ["numGuests"])
|
||||||
var numberOfGuests: Long = 0
|
var numberOfGuests: Long = 0
|
||||||
|
|
||||||
/*@JsonField(name = ["guestList"])
|
/*@JsonField(name = ["guestList"])
|
||||||
var guestList: HashMap<String, HashMap<String, Any>>? = null*/
|
var guestList: HashMap<String, HashMap<String, Any>>? = null*/
|
||||||
@JsonField(name = ["participants"])
|
@JsonField(name = ["participants"])
|
||||||
var participants: HashMap<String, Participant>? = null
|
var participants: HashMap<String, Participant>? = null
|
||||||
|
|
||||||
@JsonField(name = ["participantType"], typeConverter = EnumParticipantTypeConverter::class)
|
@JsonField(name = ["participantType"], typeConverter = EnumParticipantTypeConverter::class)
|
||||||
var participantType: Participant.ParticipantType? = null
|
var participantType: Participant.ParticipantType? = null
|
||||||
|
|
||||||
@JsonField(name = ["hasPassword"])
|
@JsonField(name = ["hasPassword"])
|
||||||
var hasPassword: Boolean = false
|
var hasPassword: Boolean = false
|
||||||
|
|
||||||
@JsonField(name = ["sessionId"])
|
@JsonField(name = ["sessionId"])
|
||||||
var sessionId: String? = null
|
var sessionId: String? = null
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
var password: String? = null
|
var password: String? = null
|
||||||
|
|
||||||
@JsonField(name = ["isFavorite"])
|
@JsonField(name = ["isFavorite"])
|
||||||
var favorite: Boolean = false
|
var favorite: Boolean = false
|
||||||
|
|
||||||
@JsonField(name = ["lastActivity"])
|
@JsonField(name = ["lastActivity"])
|
||||||
var lastActivity: Long = 0
|
var lastActivity: Long = 0
|
||||||
|
|
||||||
@JsonField(name = ["unreadMessages"])
|
@JsonField(name = ["unreadMessages"])
|
||||||
var unreadMessages: Int = 0
|
var unreadMessages: Int = 0
|
||||||
|
|
||||||
@JsonField(name = ["unreadMention"])
|
@JsonField(name = ["unreadMention"])
|
||||||
var unreadMention: Boolean = false
|
var unreadMention: Boolean = false
|
||||||
|
|
||||||
@JsonField(name = ["lastMessage"])
|
@JsonField(name = ["lastMessage"])
|
||||||
var lastMessage: ChatMessage? = null
|
var lastMessage: ChatMessage? = null
|
||||||
|
|
||||||
@JsonField(name = ["objectType"])
|
@JsonField(name = ["objectType"])
|
||||||
var objectType: String? = null
|
var objectType: String? = null
|
||||||
|
|
||||||
@JsonField(name = ["notificationLevel"], typeConverter = EnumNotificationLevelConverter::class)
|
@JsonField(name = ["notificationLevel"], typeConverter = EnumNotificationLevelConverter::class)
|
||||||
var notificationLevel: NotificationLevel? = null
|
var notificationLevel: NotificationLevel? = null
|
||||||
|
|
||||||
@JsonField(name = ["readOnly"], typeConverter = EnumReadOnlyConversationConverter::class)
|
@JsonField(name = ["readOnly"], typeConverter = EnumReadOnlyConversationConverter::class)
|
||||||
var conversationReadOnlyState:
|
var conversationReadOnlyState:
|
||||||
ConversationReadOnlyState? = null
|
ConversationReadOnlyState? = null
|
||||||
|
|
||||||
@JsonField(name = ["lobbyState"], typeConverter = EnumLobbyStateConverter::class)
|
@JsonField(name = ["lobbyState"], typeConverter = EnumLobbyStateConverter::class)
|
||||||
var lobbyState: LobbyState? = null
|
var lobbyState: LobbyState? = null
|
||||||
|
|
||||||
@JsonField(name = ["lobbyTimer"])
|
@JsonField(name = ["lobbyTimer"])
|
||||||
var lobbyTimer: Long? = 0
|
var lobbyTimer: Long? = 0
|
||||||
|
|
||||||
@JsonField(name = ["lastReadMessageId"])
|
@JsonField(name = ["lastReadMessageId"])
|
||||||
var lastReadMessageId: Long = 0
|
var lastReadMessageId: Long = 0
|
||||||
|
|
||||||
@JsonField(name = ["canStartCall"])
|
@JsonField(name = ["canStartCall"])
|
||||||
var canStartCall: Boolean? = true
|
var canStartCall: Boolean? = true
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
var changing: Boolean = false
|
var changing: Boolean = false
|
||||||
|
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
val isPublic: Boolean = ConversationType.PUBLIC_CONVERSATION == type
|
val isPublic: Boolean = ConversationType.PUBLIC_CONVERSATION == type
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
val isGuest: Boolean =
|
val isGuest: Boolean =
|
||||||
Participant.ParticipantType.GUEST == participantType ||
|
Participant.ParticipantType.GUEST == participantType ||
|
||||||
|
@ -38,29 +38,37 @@ class Participant {
|
|||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["userId"])
|
@JsonField(name = ["userId"])
|
||||||
var userId: String? = null
|
var userId: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["type", "participantType"], typeConverter = EnumParticipantTypeConverter::class)
|
@JsonField(name = ["type", "participantType"], typeConverter = EnumParticipantTypeConverter::class)
|
||||||
var type: ParticipantType? = null
|
var type: ParticipantType? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["name"])
|
@JsonField(name = ["name"])
|
||||||
var name: String? = null
|
var name: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["displayName"])
|
@JsonField(name = ["displayName"])
|
||||||
var displayName: String? = null
|
var displayName: String? = null
|
||||||
|
|
||||||
/*@JsonField(name = "lastPing")
|
/*@JsonField(name = "lastPing")
|
||||||
public long lastPing;*/
|
public long lastPing;*/
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["sessionId"])
|
@JsonField(name = ["sessionId"])
|
||||||
var sessionId: String? = null
|
var sessionId: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["conversationId"])
|
@JsonField(name = ["conversationId"])
|
||||||
var conversationId: Long = 0
|
var conversationId: Long = 0
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["inCall", "call"], typeConverter = EnumParticipantFlagsConverter::class)
|
@JsonField(name = ["inCall", "call"], typeConverter = EnumParticipantFlagsConverter::class)
|
||||||
var participantFlags: ParticipantFlags? = null
|
var participantFlags: ParticipantFlags? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["source"])
|
@JsonField(name = ["source"])
|
||||||
var source: String? = null
|
var source: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
var selected = false
|
var selected = false
|
||||||
|
@ -32,30 +32,39 @@ class DecryptedPushMessage {
|
|||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["app"])
|
@JsonField(name = ["app"])
|
||||||
var app: String? = null
|
var app: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["type"])
|
@JsonField(name = ["type"])
|
||||||
var type: String? = null
|
var type: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["subject"])
|
@JsonField(name = ["subject"])
|
||||||
var subject: String? = null
|
var subject: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["id"])
|
@JsonField(name = ["id"])
|
||||||
var id: String? = null
|
var id: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["nid"])
|
@JsonField(name = ["nid"])
|
||||||
var notificationId: Long? = null
|
var notificationId: Long? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["delete"])
|
@JsonField(name = ["delete"])
|
||||||
var delete = false
|
var delete = false
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["delete-all"])
|
@JsonField(name = ["delete-all"])
|
||||||
var deleteAll = false
|
var deleteAll = false
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
var notificationUser: NotificationUser? = null
|
var notificationUser: NotificationUser? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
var text: String? = null
|
var text: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
var timestamp: Long = 0
|
var timestamp: Long = 0
|
||||||
|
@ -32,6 +32,7 @@ class UserProfileData {
|
|||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["display-name", "displayname"])
|
@JsonField(name = ["display-name", "displayname"])
|
||||||
var displayName: String? = null
|
var displayName: String? = null
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
@JsonField(name = ["id"])
|
@JsonField(name = ["id"])
|
||||||
var userId: String? = null
|
var userId: String? = null
|
||||||
|
@ -72,22 +72,27 @@ data class ErrorModel(
|
|||||||
* error in connecting to repository (Server or Database)
|
* error in connecting to repository (Server or Database)
|
||||||
*/
|
*/
|
||||||
NO_CONNECTION,
|
NO_CONNECTION,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* error in getting value (Json Error, Server Error, etc)
|
* error in getting value (Json Error, Server Error, etc)
|
||||||
*/
|
*/
|
||||||
BAD_RESPONSE,
|
BAD_RESPONSE,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time out error
|
* Time out error
|
||||||
*/
|
*/
|
||||||
TIMEOUT,
|
TIMEOUT,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* no data available in repository
|
* no data available in repository
|
||||||
*/
|
*/
|
||||||
EMPTY_RESPONSE,
|
EMPTY_RESPONSE,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* an unexpected error
|
* an unexpected error
|
||||||
*/
|
*/
|
||||||
NOT_DEFINED,
|
NOT_DEFINED,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bad credentials
|
* bad credentials
|
||||||
*/
|
*/
|
||||||
|
@ -43,10 +43,10 @@ import com.nextcloud.talk.newarch.data.source.remote.ApiErrorHandler
|
|||||||
import com.nextcloud.talk.newarch.data.source.remote.ApiService
|
import com.nextcloud.talk.newarch.data.source.remote.ApiService
|
||||||
import com.nextcloud.talk.newarch.domain.repository.offline.UsersRepository
|
import com.nextcloud.talk.newarch.domain.repository.offline.UsersRepository
|
||||||
import com.nextcloud.talk.newarch.domain.repository.online.NextcloudTalkRepository
|
import com.nextcloud.talk.newarch.domain.repository.online.NextcloudTalkRepository
|
||||||
|
import com.nextcloud.talk.newarch.utils.NetworkComponents
|
||||||
import com.nextcloud.talk.newarch.utils.NetworkUtils
|
import com.nextcloud.talk.newarch.utils.NetworkUtils
|
||||||
import com.nextcloud.talk.newarch.utils.NetworkUtils.GetProxyRunnable
|
import com.nextcloud.talk.newarch.utils.NetworkUtils.GetProxyRunnable
|
||||||
import com.nextcloud.talk.newarch.utils.NetworkUtils.MagicAuthenticator
|
import com.nextcloud.talk.newarch.utils.NetworkUtils.MagicAuthenticator
|
||||||
import com.nextcloud.talk.newarch.utils.NetworkComponents
|
|
||||||
import com.nextcloud.talk.utils.LoggingUtils
|
import com.nextcloud.talk.utils.LoggingUtils
|
||||||
import com.nextcloud.talk.utils.preferences.AppPreferences
|
import com.nextcloud.talk.utils.preferences.AppPreferences
|
||||||
import com.nextcloud.talk.utils.singletons.AvatarStatusCodeHolder
|
import com.nextcloud.talk.utils.singletons.AvatarStatusCodeHolder
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
package com.nextcloud.talk.newarch.features.account.loginentry
|
package com.nextcloud.talk.newarch.features.account.loginentry
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.util.Log
|
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.nextcloud.talk.models.LoginData
|
import com.nextcloud.talk.models.LoginData
|
||||||
|
@ -57,7 +57,7 @@ class ChatViewModel constructor(application: Application,
|
|||||||
fun init(user: UserNgEntity, conversationToken: String, conversationPassword: String?) {
|
fun init(user: UserNgEntity, conversationToken: String, conversationPassword: String?) {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
this@ChatViewModel.user = user
|
this@ChatViewModel.user = user
|
||||||
this@ChatViewModel.initConversation = conversationsRepository.getConversationForUserWithToken(user.id!!, conversationToken)
|
this@ChatViewModel.initConversation = conversationsRepository.getConversationForUserWithToken(user.id, conversationToken)
|
||||||
this@ChatViewModel.conversationPassword = conversationPassword
|
this@ChatViewModel.conversationPassword = conversationPassword
|
||||||
globalService.getConversation(conversationToken, this@ChatViewModel)
|
globalService.getConversation(conversationToken, this@ChatViewModel)
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ class ChatViewModel constructor(application: Application,
|
|||||||
override suspend fun gotConversationInfoForUser(userNgEntity: UserNgEntity, conversation: Conversation?, operationStatus: GlobalServiceInterface.OperationStatus) {
|
override suspend fun gotConversationInfoForUser(userNgEntity: UserNgEntity, conversation: Conversation?, operationStatus: GlobalServiceInterface.OperationStatus) {
|
||||||
if (operationStatus == GlobalServiceInterface.OperationStatus.STATUS_OK) {
|
if (operationStatus == GlobalServiceInterface.OperationStatus.STATUS_OK) {
|
||||||
if (userNgEntity.id == user.id && conversation!!.token == initConversation?.token) {
|
if (userNgEntity.id == user.id && conversation!!.token == initConversation?.token) {
|
||||||
this.conversation.value = conversationsRepository.getConversationForUserWithToken(user.id!!, conversation.token!!)
|
this.conversation.value = conversationsRepository.getConversationForUserWithToken(user.id, conversation.token!!)
|
||||||
conversation.token?.let { conversationToken ->
|
conversation.token?.let { conversationToken ->
|
||||||
globalService.joinConversation(conversationToken, conversationPassword, this)
|
globalService.joinConversation(conversationToken, conversationPassword, this)
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ class ConversationsListView : BaseView() {
|
|||||||
bundle.putString(BundleKeys.KEY_ROOM_ID, conversation.conversationId)
|
bundle.putString(BundleKeys.KEY_ROOM_ID, conversation.conversationId)
|
||||||
bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION, Parcels.wrap(conversation))
|
bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION, Parcels.wrap(conversation))
|
||||||
ConductorRemapping.remapChatController(
|
ConductorRemapping.remapChatController(
|
||||||
router, user.id!!, conversation.token!!,
|
router, user.id, conversation.token!!,
|
||||||
bundle, false
|
bundle, false
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ class ConversationsListViewModel constructor(
|
|||||||
filterLiveData.value = null
|
filterLiveData.value = null
|
||||||
Transformations.switchMap(filterLiveData) { filter ->
|
Transformations.switchMap(filterLiveData) { filter ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
conversationsRepository.getConversationsForUser(user.id!!, filter)
|
conversationsRepository.getConversationsForUser(user.id, filter)
|
||||||
} else {
|
} else {
|
||||||
liveData {
|
liveData {
|
||||||
listOf<Conversation>()
|
listOf<Conversation>()
|
||||||
@ -99,7 +99,7 @@ class ConversationsListViewModel constructor(
|
|||||||
object : UseCaseResponse<GenericOverall> {
|
object : UseCaseResponse<GenericOverall> {
|
||||||
override suspend fun onSuccess(result: GenericOverall) {
|
override suspend fun onSuccess(result: GenericOverall) {
|
||||||
conversationsRepository.deleteConversation(
|
conversationsRepository.deleteConversation(
|
||||||
globalService.currentUserLiveData.value!!.id!!, conversation
|
globalService.currentUserLiveData.value!!.id, conversation
|
||||||
.conversationId!!
|
.conversationId!!
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ class ConversationsListViewModel constructor(
|
|||||||
object : UseCaseResponse<GenericOverall> {
|
object : UseCaseResponse<GenericOverall> {
|
||||||
override suspend fun onSuccess(result: GenericOverall) {
|
override suspend fun onSuccess(result: GenericOverall) {
|
||||||
conversationsRepository.deleteConversation(
|
conversationsRepository.deleteConversation(
|
||||||
globalService.currentUserLiveData.value!!.id!!, conversation
|
globalService.currentUserLiveData.value!!.id, conversation
|
||||||
.conversationId!!
|
.conversationId!!
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ class ConversationsListViewModel constructor(
|
|||||||
object : UseCaseResponse<GenericOverall> {
|
object : UseCaseResponse<GenericOverall> {
|
||||||
override suspend fun onSuccess(result: GenericOverall) {
|
override suspend fun onSuccess(result: GenericOverall) {
|
||||||
conversationsRepository.setFavoriteValueForConversation(
|
conversationsRepository.setFavoriteValueForConversation(
|
||||||
globalService.currentUserLiveData.value!!.id!!,
|
globalService.currentUserLiveData.value!!.id,
|
||||||
conversation.conversationId!!, favorite
|
conversation.conversationId!!, favorite
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -202,7 +202,7 @@ class ConversationsListViewModel constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
conversationsRepository.saveConversationsForUser(
|
conversationsRepository.saveConversationsForUser(
|
||||||
internalUserId!!,
|
internalUserId,
|
||||||
mutableList, true)
|
mutableList, true)
|
||||||
messageData = ""
|
messageData = ""
|
||||||
conversationsLoadingLock.unlock()
|
conversationsLoadingLock.unlock()
|
||||||
@ -223,7 +223,7 @@ class ConversationsListViewModel constructor(
|
|||||||
value: Boolean
|
value: Boolean
|
||||||
) {
|
) {
|
||||||
conversationsRepository.setChangingValueForConversation(
|
conversationsRepository.setChangingValueForConversation(
|
||||||
globalService.currentUserLiveData.value!!.id!!, conversation
|
globalService.currentUserLiveData.value!!.id, conversation
|
||||||
.conversationId!!, value
|
.conversationId!!, value
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ import kotlinx.serialization.json.Json
|
|||||||
|
|
||||||
class SignalingSettingsConverter {
|
class SignalingSettingsConverter {
|
||||||
val json = Json(MagicJson.customJsonConfiguration)
|
val json = Json(MagicJson.customJsonConfiguration)
|
||||||
|
|
||||||
@TypeConverter
|
@TypeConverter
|
||||||
fun fromSignalingSettingsToString(signalingSettings: SignalingSettings?): String {
|
fun fromSignalingSettingsToString(signalingSettings: SignalingSettings?): String {
|
||||||
return if (signalingSettings == null) {
|
return if (signalingSettings == null) {
|
||||||
|
@ -57,6 +57,7 @@ abstract class TalkDatabase : RoomDatabase() {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val DB_NAME = "talk.db"
|
private const val DB_NAME = "talk.db"
|
||||||
|
|
||||||
@Volatile
|
@Volatile
|
||||||
private var INSTANCE: TalkDatabase? = null
|
private var INSTANCE: TalkDatabase? = null
|
||||||
|
|
||||||
|
@ -25,8 +25,10 @@ package com.nextcloud.talk.newarch.local.models.other
|
|||||||
enum class UserStatus {
|
enum class UserStatus {
|
||||||
// account that is NOT actively used by the UI, but might be used by background tasks
|
// account that is NOT actively used by the UI, but might be used by background tasks
|
||||||
DORMANT,
|
DORMANT,
|
||||||
|
|
||||||
// currently active account
|
// currently active account
|
||||||
ACTIVE,
|
ACTIVE,
|
||||||
|
|
||||||
// account that will be deleted in the near future
|
// account that will be deleted in the near future
|
||||||
PENDING_DELETE
|
PENDING_DELETE
|
||||||
}
|
}
|
||||||
|
@ -42,9 +42,9 @@ import com.nextcloud.talk.newarch.domain.usecases.GetParticipantsForCallUseCase
|
|||||||
import com.nextcloud.talk.newarch.domain.usecases.base.UseCaseResponse
|
import com.nextcloud.talk.newarch.domain.usecases.base.UseCaseResponse
|
||||||
import com.nextcloud.talk.newarch.local.models.UserNgEntity
|
import com.nextcloud.talk.newarch.local.models.UserNgEntity
|
||||||
import com.nextcloud.talk.newarch.local.models.toUser
|
import com.nextcloud.talk.newarch.local.models.toUser
|
||||||
import com.nextcloud.talk.newarch.utils.NetworkComponents
|
|
||||||
import com.nextcloud.talk.newarch.utils.Images
|
import com.nextcloud.talk.newarch.utils.Images
|
||||||
import com.nextcloud.talk.newarch.utils.MagicJson
|
import com.nextcloud.talk.newarch.utils.MagicJson
|
||||||
|
import com.nextcloud.talk.newarch.utils.NetworkComponents
|
||||||
import com.nextcloud.talk.utils.ApiUtils
|
import com.nextcloud.talk.utils.ApiUtils
|
||||||
import com.nextcloud.talk.utils.NotificationUtils
|
import com.nextcloud.talk.utils.NotificationUtils
|
||||||
import com.nextcloud.talk.utils.PushUtils
|
import com.nextcloud.talk.utils.PushUtils
|
||||||
@ -57,7 +57,6 @@ import org.koin.core.KoinComponent
|
|||||||
import org.koin.core.inject
|
import org.koin.core.inject
|
||||||
import org.koin.core.parameter.parametersOf
|
import org.koin.core.parameter.parametersOf
|
||||||
import org.parceler.Parcels
|
import org.parceler.Parcels
|
||||||
import retrofit2.Retrofit
|
|
||||||
import java.security.InvalidKeyException
|
import java.security.InvalidKeyException
|
||||||
import java.security.NoSuchAlgorithmException
|
import java.security.NoSuchAlgorithmException
|
||||||
import java.security.PrivateKey
|
import java.security.PrivateKey
|
||||||
@ -291,7 +290,7 @@ class CallService : Service(), KoinComponent, CoroutineScope {
|
|||||||
getConversationUseCase.invoke(this, parametersOf(user, conversationToken), object : UseCaseResponse<ConversationOverall> {
|
getConversationUseCase.invoke(this, parametersOf(user, conversationToken), object : UseCaseResponse<ConversationOverall> {
|
||||||
override suspend fun onSuccess(result: ConversationOverall) {
|
override suspend fun onSuccess(result: ConversationOverall) {
|
||||||
val internalConversation = result.ocs.data
|
val internalConversation = result.ocs.data
|
||||||
conversationsRepository.saveConversationsForUser(user.id!!, listOf(internalConversation), false)
|
conversationsRepository.saveConversationsForUser(user.id, listOf(internalConversation), false)
|
||||||
conversation = result.ocs.data
|
conversation = result.ocs.data
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,7 +308,7 @@ class CallService : Service(), KoinComponent, CoroutineScope {
|
|||||||
endIncomingConversation(true)
|
endIncomingConversation(true)
|
||||||
activeNotification = generatedNotificationId
|
activeNotification = generatedNotificationId
|
||||||
val notification = builder.build()
|
val notification = builder.build()
|
||||||
notification.extras.putLong(BundleKeys.KEY_INTERNAL_USER_ID, user.id!!)
|
notification.extras.putLong(BundleKeys.KEY_INTERNAL_USER_ID, user.id)
|
||||||
notification.extras.putLong(BundleKeys.KEY_NOTIFICATION_ID, internalNotificationId)
|
notification.extras.putLong(BundleKeys.KEY_NOTIFICATION_ID, internalNotificationId)
|
||||||
notification.flags = notification.flags or Notification.FLAG_INSISTENT
|
notification.flags = notification.flags or Notification.FLAG_INSISTENT
|
||||||
startForeground(generatedNotificationId.hashCode(), notification)
|
startForeground(generatedNotificationId.hashCode(), notification)
|
||||||
|
@ -71,7 +71,7 @@ class GlobalService constructor(usersRepository: UsersRepository,
|
|||||||
object : UseCaseResponse<ConversationOverall> {
|
object : UseCaseResponse<ConversationOverall> {
|
||||||
override suspend fun onSuccess(result: ConversationOverall) {
|
override suspend fun onSuccess(result: ConversationOverall) {
|
||||||
currentUser?.let {
|
currentUser?.let {
|
||||||
conversationsRepository.saveConversationsForUser(it.id!!, listOf(result.ocs.data), false)
|
conversationsRepository.saveConversationsForUser(it.id, listOf(result.ocs.data), false)
|
||||||
globalServiceInterface.gotConversationInfoForUser(it, result.ocs.data, GlobalServiceInterface.OperationStatus.STATUS_OK)
|
globalServiceInterface.gotConversationInfoForUser(it, result.ocs.data, GlobalServiceInterface.OperationStatus.STATUS_OK)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -94,8 +94,8 @@ class GlobalService constructor(usersRepository: UsersRepository,
|
|||||||
object : UseCaseResponse<ConversationOverall> {
|
object : UseCaseResponse<ConversationOverall> {
|
||||||
override suspend fun onSuccess(result: ConversationOverall) {
|
override suspend fun onSuccess(result: ConversationOverall) {
|
||||||
currentUser?.let {
|
currentUser?.let {
|
||||||
conversationsRepository.saveConversationsForUser(it.id!!, listOf(result.ocs.data), false)
|
conversationsRepository.saveConversationsForUser(it.id, listOf(result.ocs.data), false)
|
||||||
currentConversation = conversationsRepository.getConversationForUserWithToken(it.id!!, result.ocs!!.data!!.token!!)
|
currentConversation = conversationsRepository.getConversationForUserWithToken(it.id, result.ocs!!.data!!.token!!)
|
||||||
globalServiceInterface.joinedConversationForUser(it, currentConversation, GlobalServiceInterface.OperationStatus.STATUS_OK)
|
globalServiceInterface.joinedConversationForUser(it, currentConversation, GlobalServiceInterface.OperationStatus.STATUS_OK)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ class ShortcutService constructor(private var context: Context,
|
|||||||
currentUser = user
|
currentUser = user
|
||||||
var internalUserId: Long = -1
|
var internalUserId: Long = -1
|
||||||
currentUser?.let {
|
currentUser?.let {
|
||||||
internalUserId = it.id!!
|
internalUserId = it.id
|
||||||
}
|
}
|
||||||
conversationsRepository.getShortcutTargetConversations(internalUserId)
|
conversationsRepository.getShortcutTargetConversations(internalUserId)
|
||||||
}
|
}
|
||||||
|
@ -263,6 +263,6 @@ class DatabaseStorageModule(
|
|||||||
override fun onRestoreInstanceState(savedState: Bundle) {}
|
override fun onRestoreInstanceState(savedState: Bundle) {}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
accountIdentifier = conversationUser.id!!
|
accountIdentifier = conversationUser.id
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -242,7 +242,7 @@ class MagicWebSocketInstance internal constructor(
|
|||||||
HashMap<String, String?>()
|
HashMap<String, String?>()
|
||||||
refreshChatHashMap[KEY_CONVERSATION_TOKEN] = messageHashMap["roomid"] as String?
|
refreshChatHashMap[KEY_CONVERSATION_TOKEN] = messageHashMap["roomid"] as String?
|
||||||
refreshChatHashMap[KEY_INTERNAL_USER_ID] =
|
refreshChatHashMap[KEY_INTERNAL_USER_ID] =
|
||||||
java.lang.Long.toString(conversationUser.id!!)
|
java.lang.Long.toString(conversationUser.id)
|
||||||
eventBus.post(
|
eventBus.post(
|
||||||
WebSocketCommunicationEvent("refreshChat", refreshChatHashMap)
|
WebSocketCommunicationEvent("refreshChat", refreshChatHashMap)
|
||||||
)
|
)
|
||||||
|
@ -102,6 +102,7 @@ class WebSocketConnectionHelper : KoinComponent {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val magicWebSocketInstanceMap: MutableMap<Long, MagicWebSocketInstance> = HashMap()
|
private val magicWebSocketInstanceMap: MutableMap<Long, MagicWebSocketInstance> = HashMap()
|
||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
fun getMagicWebSocketInstanceForUserId(
|
fun getMagicWebSocketInstanceForUserId(
|
||||||
userId: Long): MagicWebSocketInstance? {
|
userId: Long): MagicWebSocketInstance? {
|
||||||
@ -128,7 +129,7 @@ class WebSocketConnectionHelper : KoinComponent {
|
|||||||
deleteExternalSignalingInstanceForUserEntity(userId)
|
deleteExternalSignalingInstanceForUserEntity(userId)
|
||||||
}
|
}
|
||||||
magicWebSocketInstance = MagicWebSocketInstance(userEntity, generatedURL, webSocketTicket!!)
|
magicWebSocketInstance = MagicWebSocketInstance(userEntity, generatedURL, webSocketTicket!!)
|
||||||
magicWebSocketInstanceMap[userEntity.id!!] = magicWebSocketInstance
|
magicWebSocketInstanceMap[userEntity.id] = magicWebSocketInstance
|
||||||
return magicWebSocketInstance
|
return magicWebSocketInstance
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user