mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Merge pull request #5594 from vector-im/feature/aris/thread_root_permalink_navigation
Improve permalink on thread root message
This commit is contained in:
commit
d484ba07cd
2 changed files with 9 additions and 1 deletions
1
changelog.d/5567.misc
Normal file
1
changelog.d/5567.misc
Normal file
|
@ -0,0 +1 @@
|
|||
Permalinks to root thread messages will now navigate you within the thread timeline
|
|
@ -38,6 +38,7 @@ import org.matrix.android.sdk.api.session.permalinks.PermalinkService
|
|||
import org.matrix.android.sdk.api.session.room.model.Membership
|
||||
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
||||
import org.matrix.android.sdk.api.session.room.model.RoomType
|
||||
import org.matrix.android.sdk.api.session.room.timeline.isRootThread
|
||||
import javax.inject.Inject
|
||||
|
||||
class PermalinkHandler @Inject constructor(private val activeSessionHolder: ActiveSessionHolder,
|
||||
|
@ -89,7 +90,13 @@ class PermalinkHandler @Inject constructor(private val activeSessionHolder: Acti
|
|||
|
||||
val rootThreadEventId = permalinkData.eventId?.let { eventId ->
|
||||
val room = roomId?.let { session?.getRoom(it) }
|
||||
room?.getTimelineEvent(eventId)?.root?.getRootThreadEventId()
|
||||
|
||||
val rootThreadEventId = room?.getTimelineEvent(eventId)?.root?.getRootThreadEventId()
|
||||
rootThreadEventId ?: if (room?.getTimelineEvent(eventId)?.isRootThread() == true) {
|
||||
eventId
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
openRoom(
|
||||
navigationInterceptor,
|
||||
|
|
Loading…
Reference in a new issue