From dacb5d42acd834b6657a4c14145365c7c9aa1d40 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 29 Jul 2019 15:08:54 +0100 Subject: [PATCH] Support IS v2 auth in preview bar --- src/components/views/dialogs/AddressPickerDialog.js | 7 ++++++- src/components/views/rooms/RoomPreviewBar.js | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/views/dialogs/AddressPickerDialog.js b/src/components/views/dialogs/AddressPickerDialog.js index 38b478d462..7ff9e8f233 100644 --- a/src/components/views/dialogs/AddressPickerDialog.js +++ b/src/components/views/dialogs/AddressPickerDialog.js @@ -520,7 +520,12 @@ module.exports = React.createClass({ const isAccessToken = await authClient.getAccessToken(); if (cancelled) return null; - const lookup = await MatrixClientPeg.get().lookupThreePid(medium, address, undefined, isAccessToken); + const lookup = await MatrixClientPeg.get().lookupThreePid( + medium, + address, + undefined /* callback */, + isAccessToken, + ); if (cancelled || lookup === null || !lookup.mxid) return null; const profile = await MatrixClientPeg.get().getProfileInfo(lookup.mxid); diff --git a/src/components/views/rooms/RoomPreviewBar.js b/src/components/views/rooms/RoomPreviewBar.js index db5d16c8cb..0fb8146943 100644 --- a/src/components/views/rooms/RoomPreviewBar.js +++ b/src/components/views/rooms/RoomPreviewBar.js @@ -25,6 +25,7 @@ import MatrixClientPeg from '../../../MatrixClientPeg'; import dis from '../../../dispatcher'; import classNames from 'classnames'; import { _t } from '../../../languageHandler'; +import IdentityAuthClient from '../../../IdentityAuthClient'; const MessageCase = Object.freeze({ NotLoggedIn: "NotLoggedIn", @@ -111,8 +112,13 @@ module.exports = React.createClass({ if (this.props.inviterName && this.props.invitedEmail) { this.setState({busy: true}); try { + const authClient = new IdentityAuthClient(); + const isAccessToken = await authClient.getAccessToken(); const result = await MatrixClientPeg.get().lookupThreePid( - 'email', this.props.invitedEmail, + 'email', + this.props.invitedEmail, + undefined /* callback */, + isAccessToken, ); this.setState({invitedEmailMxid: result.mxid}); } catch (err) {