Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Handle all the segments of a v3 event ID #2827

Merged
merged 1 commit into from
Mar 28, 2019
Merged

Conversation

turt2live
Copy link
Member

They may contain slashes, so it is not suitable to just pull the first segment after the room ID. Instead, we just recompile the event ID from known source, assuming everything afterwards is an event ID.

Fixes element-hq/element-web#8315

This will need adapting to support element-hq/element-web#9149

They may contain slashes, so it is not suitable to just pull the first segment after the room ID. Instead, we just recompile the event ID from known source, assuming everything afterwards is an event ID.

Fixes element-hq/element-web#8315

This will need adapting to support element-hq/element-web#9149
@turt2live turt2live requested a review from a team March 26, 2019 05:03
@@ -1561,7 +1561,16 @@ export default React.createClass({
} else if (screen.indexOf('room/') == 0) {
const segments = screen.substring(5).split('/');
const roomString = segments[0];
const eventId = segments[1]; // undefined if no event id given
let eventId = segments.splice(1).join("/"); // empty string if no event id given
Copy link
Member

Choose a reason for hiding this comment

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

would screen.substring(5).split('/', 1) be shorter / clearer / faster?

Copy link
Member Author

Choose a reason for hiding this comment

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

This wouldn't fix the problem:
image

(note: part2 goes missing)

Copy link
Member

Choose a reason for hiding this comment

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

oh yes, I forgot / failed to realise that js's string.split is different and less useful than string.split in any other language :/

Copy link
Member Author

Choose a reason for hiding this comment

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

yup :|

@turt2live turt2live requested a review from dbkr March 27, 2019 18:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants