Skip to content
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

Expose MatrixEvent's internal clearEvent as a function #1784

Merged
merged 5 commits into from
Jul 14, 2021

Conversation

turt2live
Copy link
Member

@turt2live turt2live commented Jul 14, 2021

Copy link
Contributor

@germain-gg germain-gg left a comment

Choose a reason for hiding this comment

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

🙌

@turt2live turt2live requested a review from t3chguy July 14, 2021 16:08
@turt2live
Copy link
Member Author

(rr @t3chguy due to comment on the react-sdk side)

src/models/event.ts Outdated Show resolved Hide resolved
@turt2live turt2live requested a review from t3chguy July 14, 2021 16:28
*/
public getEffectiveEvent(): IEvent {
// clearEvent doesn't have all the fields, so we'll copy what we can from this.event
return Object.assign({}, this.event, this.clearEvent) as IEvent;
Copy link
Member

Choose a reason for hiding this comment

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

are you allergic to the nicer syntax :P?

return {
    ...this.event,
    ...this.clearEvent,
}

Copy link
Member Author

Choose a reason for hiding this comment

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

"nicer" - I feel it doesn't communicate the order properly given JS objects are unordered, so there's no implicit guarantee that the spread operation will be applied correctly. The spec says it will, but that's a detail someone has to remember when writing/reading the code.

Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@turt2live turt2live merged commit 6ada02e into develop Jul 14, 2021
@turt2live turt2live deleted the travis/widgets/fix-enc branch July 14, 2021 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants