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

Add support for ephemeral events from the AS API #238

Merged
merged 3 commits into from
Oct 8, 2020
Merged

Conversation

Half-Shot
Copy link
Contributor

@Half-Shot Half-Shot commented Oct 1, 2020

Depends on matrix-org/matrix-appservice-node#32, matrix-org/synapse#8437

Most of the interesting things are in those two PRs, but this means we can handle ephemeral data from the AS api rather than just /sync.

@@ -634,6 +635,9 @@ export class Bridge {
}
return undefined;
});
this.appservice.on("ephemeral", async (event) =>
this.onEphemeralEvent(event as unknown as EphemeralEvent)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this really guaranteed to be an EphemeralEvent or is as unknown as X the new any?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's guaranteed. matrix-appservice-node doesn't have types and will send us a Record<string, unknown> but that doesn't cast to a EphemeralEvent easily. The homeserver will only send us these events however.

Copy link
Contributor

@jaller94 jaller94 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@Half-Shot Half-Shot merged commit 0d9fa36 into develop Oct 8, 2020
@Half-Shot Half-Shot deleted the hs/msc2409 branch May 2, 2023 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants