You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Allow sender for backwards compat
This commit is contained in:
@@ -70,10 +70,16 @@ export default class BridgeTile extends React.PureComponent<IProps> {
|
|||||||
render() {
|
render() {
|
||||||
const content: IBridgeStateEvent = this.props.ev.getContent();
|
const content: IBridgeStateEvent = this.props.ev.getContent();
|
||||||
// Validate
|
// Validate
|
||||||
if (!content.bridgebot || !content.channel?.id || !content.protocol?.id) {
|
if (!content.channel?.id || !content.protocol?.id) {
|
||||||
console.warn(`Bridge info event ${this.props.ev.getId()} has missing content. Tile will not render`);
|
console.warn(`Bridge info event ${this.props.ev.getId()} has missing content. Tile will not render`);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (!content.bridgebot) {
|
||||||
|
// Bridgebot was not required previously, so in order to not break rooms we are allowing
|
||||||
|
// the sender to be used in place. When the proposal is merged, this should be removed.
|
||||||
|
console.warn(`Bridge info event ${this.props.ev.getId()} does not provide a 'bridgebot' key which is deprecated behaviour. Using sender for now.`);
|
||||||
|
content.bridgebot = this.props.ev.getSender();
|
||||||
|
}
|
||||||
const { channel, network, protocol } = content;
|
const { channel, network, protocol } = content;
|
||||||
const protocolName = protocol.displayname || protocol.id;
|
const protocolName = protocol.displayname || protocol.id;
|
||||||
const channelName = channel.displayname || channel.id;
|
const channelName = channel.displayname || channel.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user