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