mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-21 12:39:58 +01:00
Merge pull request #2759 from nextcloud/bugfix/1756/fixActiveAccountAfterSwitchByNotification
Bugfix/1756/fix active account after switch by notification
This commit is contained in:
commit
4747b9935f
@ -43,6 +43,7 @@ import com.nextcloud.talk.extensions.loadAvatar
|
||||
import com.nextcloud.talk.models.json.conversations.Conversation
|
||||
import com.nextcloud.talk.models.json.conversations.RoomOverall
|
||||
import com.nextcloud.talk.models.json.participants.Participant
|
||||
import com.nextcloud.talk.users.UserManager
|
||||
import com.nextcloud.talk.utils.ApiUtils
|
||||
import com.nextcloud.talk.utils.NotificationUtils
|
||||
import com.nextcloud.talk.utils.ParticipantPermissions
|
||||
@ -73,6 +74,9 @@ class CallNotificationActivity : CallBaseActivity() {
|
||||
@Inject
|
||||
var cache: Cache? = null
|
||||
|
||||
@Inject
|
||||
lateinit var userManager: UserManager
|
||||
|
||||
private val disposablesList: MutableList<Disposable> = ArrayList()
|
||||
private var originalBundle: Bundle? = null
|
||||
private var roomToken: String? = null
|
||||
@ -98,6 +102,8 @@ class CallNotificationActivity : CallBaseActivity() {
|
||||
userBeingCalled = extras.getParcelable(KEY_USER_ENTITY)
|
||||
originalBundle = extras
|
||||
credentials = ApiUtils.getCredentials(userBeingCalled!!.username, userBeingCalled!!.token)
|
||||
|
||||
if (userManager.setUserAsActive(userBeingCalled!!).blockingGet()) {
|
||||
setCallDescriptionText()
|
||||
if (currentConversation == null) {
|
||||
handleFromNotification()
|
||||
@ -106,6 +112,7 @@ class CallNotificationActivity : CallBaseActivity() {
|
||||
}
|
||||
initClickListeners()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
|
@ -338,6 +338,14 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
Log.d(TAG, "onNewIntent Activity: " + System.identityHashCode(this).toString())
|
||||
|
||||
val user = intent.getParcelableExtra<User>(KEY_USER_ENTITY)
|
||||
if (user != null && userManager.setUserAsActive(user).blockingGet()) {
|
||||
handleIntent(intent)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleIntent(intent: Intent) {
|
||||
handleActionFromContact(intent)
|
||||
if (intent.hasExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) {
|
||||
if (intent.getBooleanExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL, false)) {
|
||||
|
Loading…
Reference in New Issue
Block a user