Open without reading: remember for rooms opened from room
Change-Id: I6ea5675b4cfb5d65d0a5a66d41a0cd489fe263b0
This commit is contained in:
parent
d5b0ffacf8
commit
096bbb696f
@ -626,7 +626,7 @@ class TimelineFragment @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun handleOpenRoom(openRoom: RoomDetailViewEvents.OpenRoom) {
|
private fun handleOpenRoom(openRoom: RoomDetailViewEvents.OpenRoom) {
|
||||||
navigator.openRoom(requireContext(), openRoom.roomId, null)
|
navigator.openRoom(requireContext(), openRoom.roomId, null, openAnonymously = timelineArgs.openAnonymously)
|
||||||
if (openRoom.closeCurrentRoom) {
|
if (openRoom.closeCurrentRoom) {
|
||||||
requireActivity().finish()
|
requireActivity().finish()
|
||||||
}
|
}
|
||||||
@ -889,7 +889,7 @@ class TimelineFragment @Inject constructor(
|
|||||||
private fun handleJoinedToAnotherRoom(action: MessageComposerViewEvents.JoinRoomCommandSuccess) {
|
private fun handleJoinedToAnotherRoom(action: MessageComposerViewEvents.JoinRoomCommandSuccess) {
|
||||||
views.composerLayout.setTextIfDifferent("")
|
views.composerLayout.setTextIfDifferent("")
|
||||||
lockSendButton = false
|
lockSendButton = false
|
||||||
navigator.openRoom(vectorBaseActivity, action.roomId)
|
navigator.openRoom(vectorBaseActivity, action.roomId, openAnonymously = timelineArgs.openAnonymously)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleShareData() {
|
private fun handleShareData() {
|
||||||
@ -1965,7 +1965,7 @@ class TimelineFragment @Inject constructor(
|
|||||||
openRoomMemberProfile(userId)
|
openRoomMemberProfile(userId)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
})
|
}, openAnonymously = timelineArgs.openAnonymously)
|
||||||
if (!isManaged) {
|
if (!isManaged) {
|
||||||
if (title.isValidUrl() && url.isValidUrl() && URL(title).host != URL(url).host) {
|
if (title.isValidUrl() && url.isValidUrl() && URL(title).host != URL(url).host) {
|
||||||
MaterialAlertDialogBuilder(requireActivity(), R.style.ThemeOverlay_Vector_MaterialAlertDialog_NegativeDestructive)
|
MaterialAlertDialogBuilder(requireActivity(), R.style.ThemeOverlay_Vector_MaterialAlertDialog_NegativeDestructive)
|
||||||
|
@ -48,17 +48,19 @@ class PermalinkHandler @Inject constructor(private val activeSessionHolder: Acti
|
|||||||
context: Context,
|
context: Context,
|
||||||
deepLink: String?,
|
deepLink: String?,
|
||||||
navigationInterceptor: NavigationInterceptor? = null,
|
navigationInterceptor: NavigationInterceptor? = null,
|
||||||
buildTask: Boolean = false
|
buildTask: Boolean = false,
|
||||||
|
openAnonymously: Boolean = false
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val uri = deepLink?.let { Uri.parse(it) }
|
val uri = deepLink?.let { Uri.parse(it) }
|
||||||
return launch(context, uri, navigationInterceptor, buildTask)
|
return launch(context, uri, navigationInterceptor, buildTask, openAnonymously = openAnonymously)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun launch(
|
suspend fun launch(
|
||||||
context: Context,
|
context: Context,
|
||||||
deepLink: Uri?,
|
deepLink: Uri?,
|
||||||
navigationInterceptor: NavigationInterceptor? = null,
|
navigationInterceptor: NavigationInterceptor? = null,
|
||||||
buildTask: Boolean = false
|
buildTask: Boolean = false,
|
||||||
|
openAnonymously: Boolean = false
|
||||||
): Boolean {
|
): Boolean {
|
||||||
return when {
|
return when {
|
||||||
deepLink == null -> false
|
deepLink == null -> false
|
||||||
@ -68,7 +70,7 @@ class PermalinkHandler @Inject constructor(private val activeSessionHolder: Acti
|
|||||||
tryOrNull {
|
tryOrNull {
|
||||||
withContext(Dispatchers.Default) {
|
withContext(Dispatchers.Default) {
|
||||||
val permalinkData = PermalinkParser.parse(deepLink)
|
val permalinkData = PermalinkParser.parse(deepLink)
|
||||||
handlePermalink(permalinkData, deepLink, context, navigationInterceptor, buildTask)
|
handlePermalink(permalinkData, deepLink, context, navigationInterceptor, buildTask, openAnonymously = openAnonymously)
|
||||||
}
|
}
|
||||||
} ?: false
|
} ?: false
|
||||||
}
|
}
|
||||||
@ -80,7 +82,8 @@ class PermalinkHandler @Inject constructor(private val activeSessionHolder: Acti
|
|||||||
rawLink: Uri,
|
rawLink: Uri,
|
||||||
context: Context,
|
context: Context,
|
||||||
navigationInterceptor: NavigationInterceptor?,
|
navigationInterceptor: NavigationInterceptor?,
|
||||||
buildTask: Boolean
|
buildTask: Boolean,
|
||||||
|
openAnonymously: Boolean = false
|
||||||
): Boolean {
|
): Boolean {
|
||||||
return when (permalinkData) {
|
return when (permalinkData) {
|
||||||
is PermalinkData.RoomLink -> {
|
is PermalinkData.RoomLink -> {
|
||||||
@ -98,7 +101,8 @@ class PermalinkHandler @Inject constructor(private val activeSessionHolder: Acti
|
|||||||
permalinkData = permalinkData,
|
permalinkData = permalinkData,
|
||||||
rawLink = rawLink,
|
rawLink = rawLink,
|
||||||
buildTask = buildTask,
|
buildTask = buildTask,
|
||||||
rootThreadEventId = rootThreadEventId
|
rootThreadEventId = rootThreadEventId,
|
||||||
|
openAnonymously = openAnonymously
|
||||||
)
|
)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
@ -163,7 +167,8 @@ class PermalinkHandler @Inject constructor(private val activeSessionHolder: Acti
|
|||||||
permalinkData: PermalinkData.RoomLink,
|
permalinkData: PermalinkData.RoomLink,
|
||||||
rawLink: Uri,
|
rawLink: Uri,
|
||||||
buildTask: Boolean,
|
buildTask: Boolean,
|
||||||
rootThreadEventId: String? = null
|
rootThreadEventId: String? = null,
|
||||||
|
openAnonymously: Boolean = false
|
||||||
) {
|
) {
|
||||||
val session = activeSessionHolder.getSafeActiveSession() ?: return
|
val session = activeSessionHolder.getSafeActiveSession() ?: return
|
||||||
if (roomId == null) {
|
if (roomId == null) {
|
||||||
@ -180,7 +185,7 @@ class PermalinkHandler @Inject constructor(private val activeSessionHolder: Acti
|
|||||||
membership?.isActive().orFalse() -> {
|
membership?.isActive().orFalse() -> {
|
||||||
if (!isSpace && membership == Membership.JOIN) {
|
if (!isSpace && membership == Membership.JOIN) {
|
||||||
// If it's a room you're in, let's just open it, you can tap back if needed
|
// If it's a room you're in, let's just open it, you can tap back if needed
|
||||||
navigationInterceptor.openJoinedRoomScreen(buildTask, roomId, eventId, rawLink, context, rootThreadEventId, roomSummary)
|
navigationInterceptor.openJoinedRoomScreen(buildTask, roomId, eventId, rawLink, context, rootThreadEventId, roomSummary, openAnonymously = openAnonymously)
|
||||||
} else {
|
} else {
|
||||||
// maybe open space preview navigator.openSpacePreview(context, roomId)? if already joined?
|
// maybe open space preview navigator.openSpacePreview(context, roomId)? if already joined?
|
||||||
navigator.openMatrixToBottomSheet(context, rawLink.toString())
|
navigator.openMatrixToBottomSheet(context, rawLink.toString())
|
||||||
@ -199,7 +204,8 @@ class PermalinkHandler @Inject constructor(private val activeSessionHolder: Acti
|
|||||||
rawLink: Uri,
|
rawLink: Uri,
|
||||||
context: Context,
|
context: Context,
|
||||||
rootThreadEventId: String?,
|
rootThreadEventId: String?,
|
||||||
roomSummary: RoomSummary
|
roomSummary: RoomSummary,
|
||||||
|
openAnonymously: Boolean = false
|
||||||
) {
|
) {
|
||||||
if (this?.navToRoom(roomId, eventId, rawLink, rootThreadEventId) != true) {
|
if (this?.navToRoom(roomId, eventId, rawLink, rootThreadEventId) != true) {
|
||||||
if (rootThreadEventId != null && userPreferencesProvider.areThreadMessagesEnabled()) {
|
if (rootThreadEventId != null && userPreferencesProvider.areThreadMessagesEnabled()) {
|
||||||
@ -211,7 +217,7 @@ class PermalinkHandler @Inject constructor(private val activeSessionHolder: Acti
|
|||||||
rootThreadEventId = rootThreadEventId)
|
rootThreadEventId = rootThreadEventId)
|
||||||
navigator.openThread(context, threadTimelineArgs, eventId)
|
navigator.openThread(context, threadTimelineArgs, eventId)
|
||||||
} else {
|
} else {
|
||||||
navigator.openRoom(context, roomId, eventId, buildTask)
|
navigator.openRoom(context, roomId, eventId, buildTask, openAnonymously = openAnonymously)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user