diff --git a/changelog.d/512.feature b/changelog.d/512.feature new file mode 100644 index 00000000..6dc4c438 --- /dev/null +++ b/changelog.d/512.feature @@ -0,0 +1 @@ +Print a notice message after successfully logging in to GitHub when conversing with the bot in a DM. diff --git a/src/Bridge.ts b/src/Bridge.ts index 9651a1e7..d0a1685a 100644 --- a/src/Bridge.ts +++ b/src/Bridge.ts @@ -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( @@ -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) {