Merge pull request #2445 from matrix-org/develop

Develop->Experimental
This commit is contained in:
Travis Ralston 2019-01-15 14:35:53 -07:00 committed by GitHub
commit 28b8ccfdb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,6 +34,9 @@ import { _t } from '../../languageHandler';
import {instanceForInstanceId, protocolNameForInstanceId} from '../../utils/DirectoryUtils'; import {instanceForInstanceId, protocolNameForInstanceId} from '../../utils/DirectoryUtils';
const MAX_NAME_LENGTH = 80;
const MAX_TOPIC_LENGTH = 160;
linkifyMatrix(linkify); linkifyMatrix(linkify);
module.exports = React.createClass({ module.exports = React.createClass({
@ -390,7 +393,6 @@ module.exports = React.createClass({
const self = this; const self = this;
let guestRead; let guestJoin; let perms; let guestRead; let guestJoin; let perms;
for (let i = 0; i < rooms.length; i++) { for (let i = 0; i < rooms.length; i++) {
const name = rooms[i].name || get_display_alias_for_room(rooms[i]) || _t('Unnamed room');
guestRead = null; guestRead = null;
guestJoin = null; guestJoin = null;
@ -410,7 +412,15 @@ module.exports = React.createClass({
perms = <div className="mx_RoomDirectory_perms">{guestRead}{guestJoin}</div>; perms = <div className="mx_RoomDirectory_perms">{guestRead}{guestJoin}</div>;
} }
let name = rooms[i].name || get_display_alias_for_room(rooms[i]) || _t('Unnamed room');
if (name.length > MAX_NAME_LENGTH) {
name = `${name.substring(0, MAX_NAME_LENGTH)}...`;
}
let topic = rooms[i].topic || ''; let topic = rooms[i].topic || '';
if (topic.length > MAX_TOPIC_LENGTH) {
topic = `${topic.substring(0, MAX_TOPIC_LENGTH)}...`;
}
topic = linkifyString(sanitizeHtml(topic)); topic = linkifyString(sanitizeHtml(topic));
rows.push( rows.push(