Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invitations: show server part from inviter #2016

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/app/pages/client/inbox/Invites.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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>
</>
)}
Comment on lines +111 to +116
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think displaying only serverName wont be sufficient here as we only display display_name and the username part could be anything. maybe we should show the entire userId as "Invited by name (@ name:server.name)"

Copy link
Contributor Author

@WebFreak001 WebFreak001 Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure this depends just on how much we want to show here, so I can change it to

Suggested change
{serverName && (
<>
{' on '}
<b>{serverName}</b>
</>
)}
{serverName && (
<>
{' ('}
<b>{senderId}</b>
{')'}
</>
)}

as well.

Could look a bit more cluttered now, depends on the trade of between form and function that you want to take here. Perhaps we should make this part a bit lighter.

Feel free to just apply the suggestion if you prefer this way.

</Text>
</Box>
<Box shrink="No">
Expand Down