Skip to content

Commit 8dfea1f

Browse files
committed
Pass message permalink to createReplyContent()
Signed-off-by: Mirian Margiani <[email protected]>
1 parent cd02ef6 commit 8dfea1f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/domain/session/room/timeline/tiles/BaseMessageTile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
Copyright 2020 Bruno Windels <[email protected]>
3+
Copyright 2024 Mirian Margiani <[email protected]>
34
45
Licensed under the Apache License, Version 2.0 (the "License");
56
you may not use this file except in compliance with the License.
@@ -147,7 +148,7 @@ export class BaseMessageTile extends SimpleTile {
147148
}
148149

149150
createReplyContent(msgtype, body) {
150-
return this._entry.createReplyContent(msgtype, body);
151+
return this._entry.createReplyContent(msgtype, body, this.permaLink);
151152
}
152153

153154
redact(reason, log) {

src/matrix/room/timeline/entries/BaseEventEntry.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
Copyright 2021 The Matrix.org Foundation C.I.C.
3+
Copyright 2024 Mirian Margiani <[email protected]>
34
45
Licensed under the Apache License, Version 2.0 (the "License");
56
you may not use this file except in compliance with the License.
@@ -185,8 +186,8 @@ export class BaseEventEntry extends BaseEntry {
185186
return createAnnotation(this.id, key);
186187
}
187188

188-
createReplyContent(msgtype, body) {
189-
return createReplyContent(this, msgtype, body);
189+
createReplyContent(msgtype, body, permaLink) {
190+
return createReplyContent(this, msgtype, body, permaLink);
190191
}
191192

192193
/** takes both remote event id and local txn id into account, see overriding in PendingEventEntry */

src/matrix/room/timeline/entries/reply.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
Copyright 2021 The Matrix.org Foundation C.I.C.
3+
Copyright 2024 Mirian Margiani <[email protected]>
34
45
Licensed under the Apache License, Version 2.0 (the "License");
56
you may not use this file except in compliance with the License.
@@ -50,7 +51,7 @@ function _createReplyContent(targetId, msgtype, body, formattedBody) {
5051
};
5152
}
5253

53-
export function createReplyContent(entry, msgtype, body) {
54+
export function createReplyContent(entry, msgtype, body, permaLink) {
5455
// TODO check for absense of sender / body / msgtype / etc?
5556
const nonTextual = fallbackForNonTextualMessage(entry.content.msgtype);
5657
const prefix = fallbackPrefix(entry.content.msgtype);

0 commit comments

Comments
 (0)