mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 00:16:59 +00:00
fix(concord): route taps on a Concord message to its channel
RouteMaker resolved Marmot and NIP-29 relay-group channel gatherers to their chat screens but had no ConcordChannel branch, so tapping a Concord message (from the Messages inbox row, a quoted note, go-to-conversation) fell through to the generic thread view instead of opening the channel. Add the branch and a routeFor(ConcordChannel) mirroring routeFor(RelayGroupChannel). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CzJ2Cwo8tg4oZq43oRa3ig
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
package com.vitorpamplona.amethyst.ui.navigation.routes
|
||||
|
||||
import com.vitorpamplona.amethyst.commons.model.concord.ConcordChannel
|
||||
import com.vitorpamplona.amethyst.commons.model.emphChat.EphemeralChatChannel
|
||||
import com.vitorpamplona.amethyst.commons.model.marmotGroups.MarmotGroupChatroom
|
||||
import com.vitorpamplona.amethyst.commons.model.nip28PublicChats.PublicChatChannel
|
||||
@@ -84,6 +85,14 @@ fun routeFor(
|
||||
return routeFor(relayGroup)
|
||||
}
|
||||
|
||||
// Concord channel content (kind 9 chat, 1111 reply, 7 reaction) lands in LocalCache as a real
|
||||
// Note attached to its ConcordChannel gatherer. Like the relay-group case above, route to the
|
||||
// Concord channel screen instead of the generic thread view it would otherwise fall through to.
|
||||
val concordChannel = note.inGatherers?.firstNotNullOfOrNull { it as? ConcordChannel }
|
||||
if (concordChannel != null) {
|
||||
return routeFor(concordChannel)
|
||||
}
|
||||
|
||||
val noteEvent = note.event ?: return Route.EventRedirect(note.idHex)
|
||||
|
||||
if (noteEvent.isGroupScoped()) {
|
||||
@@ -282,6 +291,8 @@ fun routeFor(note: RelayGroupChannel): Route = Route.RelayGroup(note.groupId.id,
|
||||
|
||||
fun routeFor(groupId: GroupId): Route = Route.RelayGroup(groupId.id, groupId.relayUrl.url)
|
||||
|
||||
fun routeFor(channel: ConcordChannel): Route = Route.Concord(channel.channelId.communityId, channel.channelId.channelId)
|
||||
|
||||
fun routeFor(user: User): Route.Profile = Route.Profile(user.pubkeyHex)
|
||||
|
||||
fun routeForUser(userHex: HexKey): Route.Profile = Route.Profile(userHex)
|
||||
|
||||
Reference in New Issue
Block a user