mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 20:10:04 +03:00
Merge pull request #5129 from vector-im/feature/aris/threads_fallback_permalink
Fix fallback permalink when threads are disabled
This commit is contained in:
commit
c479073583
3 changed files with 11 additions and 4 deletions
1
changelog.d/5128.bugfix
Normal file
1
changelog.d/5128.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Fix fallback permalink when threads are disabled
|
|
@ -88,6 +88,7 @@ import im.vector.app.core.platform.VectorBaseFragment
|
|||
import im.vector.app.core.platform.lifecycleAwareLazy
|
||||
import im.vector.app.core.platform.showOptimizedSnackbar
|
||||
import im.vector.app.core.resources.ColorProvider
|
||||
import im.vector.app.core.resources.UserPreferencesProvider
|
||||
import im.vector.app.core.time.Clock
|
||||
import im.vector.app.core.ui.views.CurrentCallsView
|
||||
import im.vector.app.core.ui.views.CurrentCallsViewPresenter
|
||||
|
@ -253,6 +254,7 @@ class TimelineFragment @Inject constructor(
|
|||
private val vectorPreferences: VectorPreferences,
|
||||
private val colorProvider: ColorProvider,
|
||||
private val dimensionConverter: DimensionConverter,
|
||||
private val userPreferencesProvider: UserPreferencesProvider,
|
||||
private val notificationUtils: NotificationUtils,
|
||||
private val matrixItemColorProvider: MatrixItemColorProvider,
|
||||
private val imageContentRenderer: ImageContentRenderer,
|
||||
|
@ -1804,7 +1806,7 @@ class TimelineFragment @Inject constructor(
|
|||
if (roomId != timelineArgs.roomId) return false
|
||||
// Navigation to same room
|
||||
if (!isThreadTimeLine()) {
|
||||
if (rootThreadEventId != null) {
|
||||
if (rootThreadEventId != null && userPreferencesProvider.areThreadMessagesEnabled()) {
|
||||
// Thread link, so PermalinkHandler will handle the navigation
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import androidx.core.net.toUri
|
|||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.extensions.isIgnored
|
||||
import im.vector.app.core.resources.UserPreferencesProvider
|
||||
import im.vector.app.core.utils.toast
|
||||
import im.vector.app.features.home.room.threads.arguments.ThreadTimelineArgs
|
||||
import im.vector.app.features.navigation.Navigator
|
||||
|
@ -40,6 +41,7 @@ import org.matrix.android.sdk.api.session.room.model.RoomType
|
|||
import javax.inject.Inject
|
||||
|
||||
class PermalinkHandler @Inject constructor(private val activeSessionHolder: ActiveSessionHolder,
|
||||
private val userPreferencesProvider: UserPreferencesProvider,
|
||||
private val navigator: Navigator) {
|
||||
|
||||
suspend fun launch(
|
||||
|
@ -200,15 +202,17 @@ class PermalinkHandler @Inject constructor(private val activeSessionHolder: Acti
|
|||
roomSummary: RoomSummary
|
||||
) {
|
||||
if (this?.navToRoom(roomId, eventId, rawLink, rootThreadEventId) != true) {
|
||||
rootThreadEventId?.let {
|
||||
if (rootThreadEventId != null && userPreferencesProvider.areThreadMessagesEnabled()) {
|
||||
val threadTimelineArgs = ThreadTimelineArgs(
|
||||
roomId = roomId,
|
||||
displayName = roomSummary.displayName,
|
||||
avatarUrl = roomSummary.avatarUrl,
|
||||
roomEncryptionTrustLevel = roomSummary.roomEncryptionTrustLevel,
|
||||
rootThreadEventId = it)
|
||||
rootThreadEventId = rootThreadEventId)
|
||||
navigator.openThread(context, threadTimelineArgs, eventId)
|
||||
} ?: navigator.openRoom(context, roomId, eventId, buildTask)
|
||||
} else {
|
||||
navigator.openRoom(context, roomId, eventId, buildTask)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue