You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Linkify room aliases. Add listener for user ID clicks.
This commit is contained in:
@@ -96,10 +96,21 @@ function matrixLinkify(linkify) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
matrixLinkify.options = {
|
matrixLinkify.options = {
|
||||||
|
events: function (href, type) {
|
||||||
|
if (type === "userid") {
|
||||||
|
return {
|
||||||
|
click: function(e) {
|
||||||
|
// sprout a MemberInfo context menu
|
||||||
|
console.log("Context => %s", href)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
formatHref: function (href, type) {
|
formatHref: function (href, type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'roomalias':
|
case 'roomalias':
|
||||||
return '#';
|
return "#/room/" + href;
|
||||||
case 'userid':
|
case 'userid':
|
||||||
return '#';
|
return '#';
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user