From e0dc853d7449599b218e60b721daf568962487bb Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Thu, 16 Dec 2021 15:27:53 +0530 Subject: [PATCH] Fill matrix.to links --- src/domain/session/room/timeline/tiles/BaseMessageTile.js | 8 ++++++++ .../web/ui/session/room/timeline/ReplyPreviewView.js | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/domain/session/room/timeline/tiles/BaseMessageTile.js b/src/domain/session/room/timeline/tiles/BaseMessageTile.js index 63f92056..7c5d7e1b 100644 --- a/src/domain/session/room/timeline/tiles/BaseMessageTile.js +++ b/src/domain/session/room/timeline/tiles/BaseMessageTile.js @@ -33,6 +33,14 @@ export class BaseMessageTile extends SimpleTile { return this._room.mediaRepository; } + get roomId() { + return this._room.id; + } + + get eventId() { + return this._entry.id; + } + get displayName() { return this._entry.displayName || this.sender; } diff --git a/src/platform/web/ui/session/room/timeline/ReplyPreviewView.js b/src/platform/web/ui/session/room/timeline/ReplyPreviewView.js index ce013c5c..393a34f5 100644 --- a/src/platform/web/ui/session/room/timeline/ReplyPreviewView.js +++ b/src/platform/web/ui/session/room/timeline/ReplyPreviewView.js @@ -49,8 +49,8 @@ export class ReplyPreviewView extends TemplateView { _renderReplyHeader(vm, children = []) { return tag.blockquote( [ - tag.a({ className: "link", href: "#" }, "In reply to"), - tag.a({ className: "pill", href: "#" }, [renderStaticAvatar(vm, 12, undefined, true), vm.displayName]), + tag.a({ className: "link", href: `https://matrix.to/#/${vm.roomId}/${vm.eventId}` }, "In reply to"), + tag.a({ className: "pill", href: `https://matrix.to/#/${vm.sender}` }, [renderStaticAvatar(vm, 12, undefined, true), vm.displayName]), tag.br(), ...children ]);