/* Copyright 2019 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import React from 'react'; import PropTypes from 'prop-types'; import {_t} from "../../../../../languageHandler"; import MatrixClientPeg from "../../../../../MatrixClientPeg"; import Pill from "../../../elements/Pill"; import {makeUserPermalink} from "../../../../../utils/permalinks/Permalinks"; import BaseAvatar from "../../../avatars/BaseAvatar"; import { ContentRepo } from "matrix-js-sdk"; const BRIDGE_EVENT_TYPES = [ "uk.half-shot.bridge", // m.bridge ]; export default class BridgeSettingsTab extends React.Component { static propTypes = { roomId: PropTypes.string.isRequired, }; constructor() { super(); this.state = { }; } componentWillMount() { } _renderBridgeCard(event, room) { const content = event.getContent(); if (!content || !content.channel || !content.protocol) { return null; } const { channel, network } = content; const protocolName = content.protocol.displayname || content.protocol.id; const channelName = channel.displayname || channel.id; const networkName = network ? network.displayname || network.id : ""; let status = null; if (content.status === "active") { status = (
Status: Active
); } else if (content.status === "disabled") { status = (Status: Disabled
); } let creator = null; if (content.creator) { creator = (
This bridge was provisioned by
The bridge is managed by the
Bridged into {channelLink} {networkLink}, on {protocolName}
); let networkIcon = null; if (networkName && network.avatar) { const avatarUrl = ContentRepo.getHttpUriForMxc( MatrixClientPeg.get().getHomeserverUrl(), network.avatar, 32, 32, "crop", ); networkIcon =Connected via {protocolName}
Below is a list of bridges connected to this room.