Send bot notice on GitHub OAuth success (#512)

* Send bot notice on GitHub OAuth success

i.e. the same as is done for Jira

* Nitpick: don't backtick plain string message
This commit is contained in:
Andrew Ferrazzutti 2022-10-04 18:05:17 -04:00 committed by GitHub
parent 31aa5e90ad
commit d570dc8a3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

1
changelog.d/512.feature Normal file
View File

@ -0,0 +1 @@
Print a notice message after successfully logging in to GitHub when conversing with the bot in a DM.

View File

@ -420,6 +420,12 @@ export class Bridge {
refresh_token: msg.data.refresh_token,
refresh_token_expires_in: msg.data.refresh_token_expires_in && ((parseInt(msg.data.refresh_token_expires_in) * 1000) + Date.now()),
} as GitHubOAuthToken));
// Some users won't have an admin room and would have gone through provisioning.
const adminRoom = [...this.adminRooms.values()].find(r => r.userId === userId);
if (adminRoom) {
await adminRoom.sendNotice("Logged into GitHub");
}
});
this.bindHandlerToQueue<IGitLabWebhookNoteEvent, GitLabIssueConnection|GitLabRepoConnection>(
@ -535,7 +541,7 @@ export class Bridge {
// Some users won't have an admin room and would have gone through provisioning.
const adminRoom = [...this.adminRooms.values()].find(r => r.userId === userId);
if (adminRoom) {
await adminRoom.sendNotice(`Logged into Jira`);
await adminRoom.sendNotice("Logged into Jira");
}
result = JiraOAuthRequestResult.Success;
} catch (ex) {