mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-02-07 06:13:38 +01:00
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:
parent
c110e64341
commit
4fbf30d3fe
1 changed files with 13 additions and 1 deletions
|
@ -32,7 +32,12 @@ import {
|
||||||
} from '../../../utils/room';
|
} from '../../../utils/room';
|
||||||
import { nameInitials } from '../../../utils/common';
|
import { nameInitials } from '../../../utils/common';
|
||||||
import { RoomAvatar } from '../../../components/room-avatar';
|
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 { Time } from '../../../components/message';
|
||||||
import { useElementSizeObserver } from '../../../hooks/useElementSizeObserver';
|
import { useElementSizeObserver } from '../../../hooks/useElementSizeObserver';
|
||||||
import { onEnterOrSpace, stopPropagation } from '../../../utils/keyboard';
|
import { onEnterOrSpace, stopPropagation } from '../../../utils/keyboard';
|
||||||
|
@ -64,6 +69,7 @@ function InviteCard({ room, userId, direct, compact, onNavigate }: InviteCardPro
|
||||||
const senderName = senderId
|
const senderName = senderId
|
||||||
? getMemberDisplayName(room, senderId) ?? getMxIdLocalPart(senderId) ?? senderId
|
? getMemberDisplayName(room, senderId) ?? getMxIdLocalPart(senderId) ?? senderId
|
||||||
: undefined;
|
: undefined;
|
||||||
|
const serverName = senderId ? getMxIdServer(senderId) : undefined;
|
||||||
|
|
||||||
const topic = useRoomTopic(room);
|
const topic = useRoomTopic(room);
|
||||||
|
|
||||||
|
@ -102,6 +108,12 @@ function InviteCard({ room, userId, direct, compact, onNavigate }: InviteCardPro
|
||||||
<Box grow="Yes">
|
<Box grow="Yes">
|
||||||
<Text size="T200" priority="300" truncate>
|
<Text size="T200" priority="300" truncate>
|
||||||
Invited by <b>{senderName}</b>
|
Invited by <b>{senderName}</b>
|
||||||
|
{serverName && (
|
||||||
|
<>
|
||||||
|
{' on '}
|
||||||
|
<b>{serverName}</b>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box shrink="No">
|
<Box shrink="No">
|
||||||
|
|
Loading…
Reference in a new issue