-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Add ability to override built in room name generator for an i18n'able one #2609
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
justjanne
approved these changes
Aug 22, 2022
@@ -2928,14 +2955,20 @@ export class Room extends TypedEventEmitter<EmittedEvents, RoomEventHandlerMap> | |||
// check for an alias, if any. for now, assume first alias is the | |||
// official one. | |||
const mRoomName = this.currentState.getStateEvents(EventType.RoomName, ""); | |||
if (mRoomName && mRoomName.getContent() && mRoomName.getContent().name) { | |||
return mRoomName.getContent().name; | |||
if (mRoomName?.getContent().name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous code did the equivalent of
Suggested change
if (mRoomName?.getContent().name) { | |
if (mRoomName?.getContent()?.name) { |
are you sure that getContent() always returns an object? We don’t have strict null checking yet in js-sdk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weeman1337
approved these changes
Aug 22, 2022
su-ex
added a commit
to SchildiChat/matrix-js-sdk
that referenced
this pull request
Sep 1, 2022
* Re-emit room state events on rooms ([\matrix-org#2607](matrix-org#2607)). * Add ability to override built in room name generator for an i18n'able one ([\matrix-org#2609](matrix-org#2609)). * Add txn_id support to sliding sync ([\matrix-org#2567](matrix-org#2567)). * Refactor Sync and fix `initialSyncLimit` ([\matrix-org#2587](matrix-org#2587)). * Use deep equality comparisons when searching for outgoing key requests by target ([\matrix-org#2623](matrix-org#2623)). Contributed by @duxovni. * Fix room membership race with PREPARED event ([\matrix-org#2613](matrix-org#2613)). Contributed by @jotto. * fixed a sliding sync bug which could cause the `roomIndexToRoomId` map to be incorrect when a new room is added in the middle of the list or when an existing room is deleted from the middle of the list. ([\matrix-org#2610](matrix-org#2610)). * Fix: Handle parsing of a beacon info event without asset ([\matrix-org#2591](matrix-org#2591)). Fixes element-hq/element-web#23078. Contributed by @kerryarchibald. * Fix finding event read up to if stable private read receipts is missing ([\matrix-org#2585](matrix-org#2585)). Fixes element-hq/element-web#23027. * fixed a sliding sync issue where history could be interpreted as live events. ([\matrix-org#2583](matrix-org#2583)).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here's what your changelog entry will look like:
✨ Features