invites: show server from inviter

Some servers are particularly prone to spam users, this helps identifying spam invites early on.
This commit is contained in:
WebFreak001 2024-10-19 12:01:49 +02:00
parent c110e64341
commit 4fbf30d3fe
No known key found for this signature in database
GPG key ID: 6374A5EBCC177695

View file

@ -32,7 +32,12 @@ import {
} from '../../../utils/room';
import { nameInitials } from '../../../utils/common';
import { RoomAvatar } from '../../../components/room-avatar';
import { addRoomIdToMDirect, getMxIdLocalPart, guessDmRoomUserId } from '../../../utils/matrix';
import {
addRoomIdToMDirect,
getMxIdLocalPart,
getMxIdServer,
guessDmRoomUserId,
} from '../../../utils/matrix';
import { Time } from '../../../components/message';
import { useElementSizeObserver } from '../../../hooks/useElementSizeObserver';
import { onEnterOrSpace, stopPropagation } from '../../../utils/keyboard';
@ -64,6 +69,7 @@ function InviteCard({ room, userId, direct, compact, onNavigate }: InviteCardPro
const senderName = senderId
? getMemberDisplayName(room, senderId) ?? getMxIdLocalPart(senderId) ?? senderId
: undefined;
const serverName = senderId ? getMxIdServer(senderId) : undefined;
const topic = useRoomTopic(room);
@ -102,6 +108,12 @@ function InviteCard({ room, userId, direct, compact, onNavigate }: InviteCardPro
<Box grow="Yes">
<Text size="T200" priority="300" truncate>
Invited by <b>{senderName}</b>
{serverName && (
<>
{' on '}
<b>{serverName}</b>
</>
)}
</Text>
</Box>
<Box shrink="No">