Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/fix-myroomnick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Fix `/myroomnick` and room cosmetics display name not updating name.
14 changes: 13 additions & 1 deletion src/app/hooks/useCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,19 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => {
?.getStateEvents(EventType.RoomMember, mx.getSafeUserId());
const content = mEvent?.getContent<RoomMemberEventContent>();
if (!content) return;
await mx.sendStateEvent(room.roomId, EventType.RoomMember, content, mx.getSafeUserId());
const updatedContent: RoomMemberEventContent = { ...content };
const withDisplay = updatedContent as RoomMemberEventContent & { displayname?: string };
if (nick == null || nick === '') {
delete withDisplay.displayname;
} else {
withDisplay.displayname = nick;
}
await mx.sendStateEvent(
room.roomId,
EventType.RoomMember,
updatedContent,
mx.getSafeUserId()
);
},
},
[Command.AddPerMessageProfileToAccount]: {
Expand Down
Loading