Module: content-repo

module:content-repo

Content Repo utility functions
Source:

Methods

(static) getHttpUriForMxc(baseUrl, mxc, width, height, resizeMethod, allowDirectLinks) → {string}

Get the HTTP URL for an MXC URI.
Parameters:
Name Type Description
baseUrl string The base homeserver url which has a content repo.
mxc string The mxc:// URI.
width Number The desired width of the thumbnail.
height Number The desired height of the thumbnail.
resizeMethod string The thumbnail resize method to use, either "crop" or "scale".
allowDirectLinks Boolean If true, return any non-mxc URLs directly. Fetching such URLs will leak information about the user to anyone they share a room with. If false, will return the emptry string for such URLs.
Source:
Returns:
The complete URL to the content.
Type
string

(static) getIdenticonUri(baseUrl, identiconString, width, height) → {string}

Get an identicon URL from an arbitrary string.
Parameters:
Name Type Description
baseUrl string The base homeserver url which has a content repo.
identiconString string The string to create an identicon for.
width Number The desired width of the image in pixels. Default: 96.
height Number The desired height of the image in pixels. Default: 96.
Source:
Returns:
The complete URL to the identicon.
Type
string