fix(concord): tell a banned member why the composer is gone

A ban removes the composer (canPost is false), but unlike a dissolution or a
missing channel key it left the bottom of the channel silently empty. It now
shows a notice that the account is banned and its messages are hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vitor Pamplona
2026-09-29 21:54:04 -04:00
co-authored by Claude Opus 5.5
parent b1e87e7667
commit 2966487f64
2 changed files with 7 additions and 0 deletions
@@ -63,11 +63,13 @@ import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols
import com.vitorpamplona.amethyst.commons.model.cache.LocalCache
import com.vitorpamplona.amethyst.commons.model.chats.formatHistoryReachDate
import com.vitorpamplona.amethyst.commons.model.concord.ConcordCommunitySession
import com.vitorpamplona.amethyst.commons.model.concord.ConcordMembership
import com.vitorpamplona.amethyst.commons.model.concordChannelLastReadRoute
import com.vitorpamplona.amethyst.commons.nip30CustomEmojis.ui.ShowEmojiSuggestionList
import com.vitorpamplona.amethyst.commons.relayClient.user.observeUserInfo
import com.vitorpamplona.amethyst.commons.resources.Res
import com.vitorpamplona.amethyst.commons.resources.back
import com.vitorpamplona.amethyst.commons.resources.concord_banned_notice
import com.vitorpamplona.amethyst.commons.resources.concord_dissolved_read_only
import com.vitorpamplona.amethyst.commons.resources.concord_private_channel_cut
import com.vitorpamplona.amethyst.commons.resources.concord_private_channel_no_key
@@ -305,6 +307,10 @@ fun ConcordChannelScreen(
// CORD-02 §9: an owner-signed tombstone seals the community read-only — the composer is
// gone (canPost() is false) and this replaces it so the seal is explained, not silent.
ConcordDissolvedNotice()
} else if (channel.membership == ConcordMembership.BANNED) {
// CORD-04 §4: every reader drops a banned author's messages, so the composer is gone;
// say why instead of leaving the bottom of the screen silently empty.
ConcordReadOnlyNotice(Res.string.concord_banned_notice)
} else if (!channel.keyHeld) {
// CORD-03 §1: a Private Channel is keyed independently; without its key there is no
// plane only its members can read, so nothing may be posted (never to the root plane).
@@ -617,6 +617,7 @@
<string name="concord_dissolved_read_only">This community has been dissolved and is now read-only. You can still read its history, but no new messages can be posted.</string>
<string name="concord_private_channel_no_key">This is a private channel and you don't hold its key, so you can't read it or post here.</string>
<string name="concord_private_channel_cut">You no longer have access to this private channel: its key was rotated without you, so you can't read new messages or post here.</string>
<string name="concord_banned_notice">You're banned from this community, so you can't post here and your messages are hidden from everyone.</string>
<string name="concord_pinned_title">Pinned messages</string>
<string name="concord_pinned_empty">No pinned messages in this channel yet.</string>
<string name="concord_pinned_unavailable">This channel's pins are sealed under a key you don't hold, so they can't be shown here, and pinning is paused until they can be read.</string>