Parse matrix-schemed URIs (#7453)
Co-authored-by: J. Ryan Stinnett <jryans@gmail.com> Co-authored-by: Dariusz Niemczyk <dariuszn@element.io> Co-authored-by: Timo K <toger5@hotmail.de> With this pr all href use matrix matrix.to links. As a consequence right-click copy link will always return get you a sharable matrix.to link.
This commit is contained in:
parent
f59ea6d7ad
commit
6712a5b1c5
12 changed files with 254 additions and 100 deletions
|
@ -24,7 +24,7 @@ import * as sdk from '../../../index';
|
|||
import dis from '../../../dispatcher/dispatcher';
|
||||
import { MatrixClientPeg } from '../../../MatrixClientPeg';
|
||||
import FlairStore from "../../../stores/FlairStore";
|
||||
import { getPrimaryPermalinkEntity, parseAppLocalLink } from "../../../utils/permalinks/Permalinks";
|
||||
import { getPrimaryPermalinkEntity, parsePermalink } from "../../../utils/permalinks/Permalinks";
|
||||
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
||||
import { Action } from "../../../dispatcher/actions";
|
||||
import { mediaFromMxc } from "../../../customisations/Media";
|
||||
|
@ -85,7 +85,7 @@ class Pill extends React.Component {
|
|||
|
||||
if (nextProps.url) {
|
||||
if (nextProps.inMessage) {
|
||||
const parts = parseAppLocalLink(nextProps.url);
|
||||
const parts = parsePermalink(nextProps.url);
|
||||
resourceId = parts.primaryEntityId; // The room/user ID
|
||||
prefix = parts.sigil; // The first character of prefix
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue