Don't set global displayname for bot in generic hooks (#215)

* Don't set global displayname for bot in generic hooks

* Create 215.bugfix
This commit is contained in:
Will Hunt 2022-03-01 12:02:54 +00:00 committed by GitHub
parent 1795b86e7b
commit 6b52457274
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

1
changelog.d/215.bugfix Normal file
View File

@ -0,0 +1 @@
Fixed an issue where the bridge bot would change it's displayname if a webhook event is handled while `generic.userIdPrefix` is not set in the config.

View File

@ -137,6 +137,10 @@ export class GenericHookConnection extends BaseConnection implements IConnection
return;
}
const sender = this.getUserId();
if (sender === this.as.botUserId) {
// Don't set the global displayname for the bot.
return;
}
const intent = this.as.getIntentForUserId(sender);
const expectedDisplayname = `${this.state.name} (Webhook)`;