Skip to content
Closed
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
11 changes: 8 additions & 3 deletions src/app/features/room/message/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,18 @@ function MessageInternal(
avatar_url: string | undefined;
displayname: string | undefined;
id: string | undefined;
"moe.sable.app.name_color": string | undefined;
"io.fsky.nyx.pronouns": any | undefined;
}
| undefined,
[mEvent]
);

// Profiles and Colors
const profile = useUserProfile(senderId, room);
const { color: usernameColor, font: usernameFont } = useSableCosmetics(senderId, room);
const cosmetics = useSableCosmetics(senderId, room);
const usernameColor = pmp?.["moe.sable.app.name_color"] ?? cosmetics.color
const usernameFont = cosmetics.font // TODO: try allowing per-message font

const [highlightMentions] = useSetting(settingsAtom, 'highlightMentions');

Expand Down Expand Up @@ -430,8 +434,9 @@ function MessageInternal(
return getParsedPronouns(rawName, parsePronouns);
}, [pmp, senderDisplayName, parsePronouns]);

const sourcePronouns = pmp?.["io.fsky.nyx.pronouns"] ?? profile.pronouns ?? []
const mergedPronouns = useMemo(() => {
const existing = profile.pronouns ? [...profile.pronouns] : [];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

#309 already handles per-message-profile's pronouns iirc

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

oh yeah, didn't notice — should I rebase onto there?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if you wish to :3

const existing = sourcePronouns ? [...sourcePronouns] : [];

if (inlinePronoun) {
const isDupe = existing.some((p) => p.summary?.toLowerCase() === inlinePronoun);
Expand All @@ -445,7 +450,7 @@ function MessageInternal(
}

return existing;
}, [profile.pronouns, inlinePronoun]);
}, [sourcePronouns, inlinePronoun]);

useEffect(() => {
if (!mobileOptionsOpen) return undefined;
Expand Down