fix(Per-Message-Profiles): whitespace only names will now disable the addition of fallback text

This commit is contained in:
Rye committed 2026-03-23 14:46:11 +01:00
1 parent 0c97bfcadc
commit 4791ed09f4
3 files changed
+8 -3

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
default: patch
---
fix the issue of empty displaynames of a persona, causing an empty fallback message, it will now ommit the fallback, if the name is empty or only consists of whitespace
+2 -2
View File
@@ -770,10 +770,10 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
if (perMessageProfile) {
content['com.beeper.per_message_profile'] = convertPerMessageProfileToBeeperFormat(
perMessageProfile,
perMessageProfile.name !== ''
perMessageProfile.name.trim() !== ''
);
if (perMessageProfile.name !== '') {
if (perMessageProfile.name.trim() !== '') {
// if a per-message profile is used, it must per spec include a fallback
const prefix = `${perMessageProfile.name}: `;
+1 -1
View File
@@ -73,7 +73,7 @@ export function convertPerMessageProfileToBeeperFormat(
};
// delete empty fields
// to-do maybe find a better way of doing it
if (!profile.name) delete beeperPMP.displayname;
if (!profile.name || profile?.name.trim().length === 0) delete beeperPMP.displayname;
if (!profile.avatarUrl) delete beeperPMP.avatar_url;
if (!profile.pronouns || profile.pronouns?.length === 0) delete beeperPMP['io.fsky.nyx.pronouns'];
if (!has_fallback) delete beeperPMP.has_fallback;