doc: a bit of code doc

This commit is contained in:
Rye committed 2026-03-18 15:03:44 +01:00
1 parent 2ad4fa055a
commit 93a93a686a
2 files changed
+10

No files matched your search

+5
View File
@@ -688,6 +688,11 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
body,
};
/**
* the currently with the room associated per-message profile, if any, so that it can be included in the message content when sending.
* This allows the server to apply the correct profile-based transformations (e.g. font size adjustments) when processing the message,
* and also allows clients to display an accurate preview of how the message will look with the profile applied while it's being composed.
*/
const perMessageProfile = await getCurrentlyUsedPerMessageProfileForRoom(mx, roomId);
if (perMessageProfile) {
@@ -380,6 +380,11 @@ function MessageInternal(
const mx = useMatrixClient();
const useAuthentication = useMediaAuthentication();
/**
* We read the per-message profile from the event content here.
* We have to do this in the message component because the per-message profile can be different for each message, and we need to read it for each message individually.
* We also want to avoid reading and parsing the per-message profile in a parent component like the timeline, because that would be inefficient and would cause unnecessary re-renders of the entire timeline whenever a per-message profile changes.
*/
const pmp: PerMessageProfileBeeperFormat | undefined = useMemo(
() =>
mEvent.event.content?.['com.beeper.per_message_profile'] as