How to use the matrix-js-sdk.ContentRepo.getHttpUriForMxc function in matrix-js-sdk

To help you get started, we’ve selected a few matrix-js-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FabricLabs / fabric / src / components / structures / RoomDirectory.js View on Github external
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>&nbsp;
                        { perms }
                        <div>
                        <div>{ get_display_alias_for_room(rooms[i]) }</div>
                    
                    
                        { rooms[i].num_joined_members }
                    
                ,
            );</div>
github FabricLabs / fabric / src / components / views / avatars / RoomAvatar.js View on Github external
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 != "");
        });
    },
github vector-im / riot-web / src / components / structures / RoomDirectory.js View on Github external
perms = <div>{guestRead}{guestJoin}</div>;
            }

            var topic = rooms[i].topic || '';
            topic = linkifyString(sanitizeHtml(topic));

            rows.push(
                 {ev.preventDefault();}}
                &gt;
                    
                        
                    
                    
                        <div>{ name }</div>&nbsp;
                        { perms }
                        <div>
                        <div>{ get_display_alias_for_room(rooms[i]) }</div>
                    
                    
                        { rooms[i].num_joined_members }
                    
                
            );</div>
github FabricLabs / fabric / src / components / views / messages / RoomAvatarEvent.js View on Github external
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>
github FabricLabs / fabric / src / Avatar.js View on Github external
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;
    },
github FabricLabs / fabric / src / components / views / rooms / RoomDetailRow.js View on Github external
<div>{ _t('World readable') }</div>
            ) : <div>;
        const guestJoin = room.guestCanJoin ? (
                <div>{ _t('Guests can join') }</div>
            ) : <div>;

        const perms = (guestRead || guestJoin) ? (<div>
            { guestRead }&nbsp;
            { guestJoin }
        </div>) : <div>;

        return 
            
                
            
            
                <div>{ name }</div>&nbsp;
                { perms }
                <div>
                    { room.topic }
                </div>
                <div>{ getDisplayAliasForRoom(room) }</div>
            
            
                { room.numJoinedMembers }
            
        ;
    },</div></div></div>