Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let topic = rooms[i].topic || '';
if (topic.length > MAX_TOPIC_LENGTH) {
topic = `${topic.substring(0, MAX_TOPIC_LENGTH)}...`;
}
topic = linkifyAndSanitizeHtml(topic);
rows.push(
{ev.preventDefault();}}
>
<div>{ name }</div>
{ perms }
<div>
<div>{ get_display_alias_for_room(rooms[i]) }</div>
{ rooms[i].num_joined_members }
,
);</div>
getImageUrls: function(props) {
return [
ContentRepo.getHttpUriForMxc(
MatrixClientPeg.get().getHomeserverUrl(),
props.oobData.avatarUrl,
Math.floor(props.width * window.devicePixelRatio),
Math.floor(props.height * window.devicePixelRatio),
props.resizeMethod,
), // highest priority
this.getRoomAvatarUrl(props),
this.getOneToOneAvatar(props), // lowest priority
].filter(function(url) {
return (url != null && url != "");
});
},
perms = <div>{guestRead}{guestJoin}</div>;
}
var topic = rooms[i].topic || '';
topic = linkifyString(sanitizeHtml(topic));
rows.push(
{ev.preventDefault();}}
>
<div>{ name }</div>
{ perms }
<div>
<div>{ get_display_alias_for_room(rooms[i]) }</div>
{ rooms[i].num_joined_members }
);</div>
var room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
var name = _t('%(senderDisplayName)s changed the avatar for %(roomName)s', {
senderDisplayName: senderDisplayName,
roomName: room ? room.name : '',
});
if (!ev.getContent().url || ev.getContent().url.trim().length === 0) {
return (
<div>
{ _t('%(senderDisplayName)s removed the room avatar.', {senderDisplayName: senderDisplayName}) }
</div>
);
}
var url = ContentRepo.getHttpUriForMxc(
MatrixClientPeg.get().getHomeserverUrl(),
ev.getContent().url,
Math.ceil(14 * window.devicePixelRatio),
Math.ceil(14 * window.devicePixelRatio),
'crop'
);
// it sucks that _tJsx doesn't support normal _t substitutions :((
return (
<div>
{ _tJsx('$senderDisplayName changed the room avatar to <img>',
[
/\$senderDisplayName/,
//,
],
[</div>
avatarUrlForUser: function(user, width, height, resizeMethod) {
const url = ContentRepo.getHttpUriForMxc(
MatrixClientPeg.get().getHomeserverUrl(), user.avatarUrl,
Math.floor(width * window.devicePixelRatio),
Math.floor(height * window.devicePixelRatio),
resizeMethod,
);
if (!url || url.length === 0) {
return null;
}
return url;
},
<div>{ _t('World readable') }</div>
) : <div>;
const guestJoin = room.guestCanJoin ? (
<div>{ _t('Guests can join') }</div>
) : <div>;
const perms = (guestRead || guestJoin) ? (<div>
{ guestRead }
{ guestJoin }
</div>) : <div>;
return
<div>{ name }</div>
{ perms }
<div>
{ room.topic }
</div>
<div>{ getDisplayAliasForRoom(room) }</div>
{ room.numJoinedMembers }
;
},</div></div></div>