feat: DM unreachable member indicators and admin auto-accept peering toggle

This commit is contained in:
Jannis Braun
2026-04-09 13:58:45 +02:00
parent 4285e44d2d
commit 70a421864c
2 changed files with 41 additions and 3 deletions
@@ -3,6 +3,13 @@ import { Avatar } from '../ui/Avatar';
import { Tooltip } from '../ui/Tooltip';
import { parseFederatedUsername, isSelf } from '../../utils/identity';
import { formatDmTimestamp, formatDmPreview } from '../../utils/dmFormatters';
import { getRejectedPeerOrigins } from '../../hooks/useWebSocket';
function isMemberUnreachable(homeInstance: string | null | undefined): boolean {
if (!homeInstance) return false;
const normalized = homeInstance.startsWith('http') ? homeInstance : `https://${homeInstance}`;
return getRejectedPeerOrigins().has(normalized);
}
interface DmListItemProps {
dm: DmChannel;
@@ -152,6 +159,13 @@ export function DmListItem({ dm, isActive, isUnread, user, onSelect, onClose, on
</svg>
</Tooltip>
)}
{firstOther && isMemberUnreachable(firstOther.homeInstance) && (
<Tooltip content="Messages may not reach this user — their instance requires manual peering approval" position="top">
<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" className="text-accent-amber opacity-70 flex-shrink-0">
<path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" />
</svg>
</Tooltip>
)}
{dm.lastMessage && (
<span className={timestampClass}>
{formatDmTimestamp(dm.lastMessage.createdAt)}