-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow passing impersonated device ID to Intent #46
Allow passing impersonated device ID to Intent #46
Conversation
When creating an impersonating client for an appservice, allow passing in a device ID to use. This will make the requests have `org.matrix.msc3202.device_id` in the query string for the client requests.
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.
Seems like a reasonable improvement, added a typing note.
src/appservice/Intent.ts
Outdated
/** | ||
* Gets the device ID this intent is for. | ||
*/ | ||
public get deviceId(): string { |
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.
May be undefined?
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.
Updated!
When creating an impersonating client for an appservice, allow passing in a device ID to use. This will make the requests have `org.matrix.msc3202.device_id` in the query string for the client requests. Appservice `intentsConfig` can be provided with a `botDeviceId`, which will be passed into creating the `Intent` for the bot user only.
3230ab4
to
2a4f9ce
Compare
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.
One type change and you're good.
/** | ||
* Get the application service's "bot" user device ID. | ||
*/ | ||
public get botDeviceId(): string { |
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.
public get botDeviceId(): string { | |
public get botDeviceId(): string|undefined { |
This still doesn't return just a string :)
This was not required after all, so closing to avoid adding unnecessary code with no proven use cases. |
When creating an impersonating client for an appservice, allow passing in a device ID to use. This will make the requests have
org.matrix.msc3202.device_id
in the query string for the client requests.Signed-off-by: Jason Robinson jasonr@element.io
Checklist