Skip to content

Commit

Permalink
Pass message permalink to createReplyContent()
Browse files Browse the repository at this point in the history
Signed-off-by: Mirian Margiani <[email protected]>
  • Loading branch information
ichthyosaurus authored and b100dian committed Dec 8, 2024
1 parent c6c6ee7 commit 72d80fa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/domain/session/room/timeline/tiles/BaseMessageTile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright 2020 Bruno Windels <[email protected]>
Copyright 2024 Mirian Margiani <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -147,7 +148,7 @@ export class BaseMessageTile extends SimpleTile {
}

createReplyContent(msgtype, body) {
return this._entry.createReplyContent(msgtype, body);
return this._entry.createReplyContent(msgtype, body, this.permaLink);
}

redact(reason, log) {
Expand Down
5 changes: 3 additions & 2 deletions src/matrix/room/timeline/entries/BaseEventEntry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright 2021 The Matrix.org Foundation C.I.C.
Copyright 2024 Mirian Margiani <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -185,8 +186,8 @@ export class BaseEventEntry extends BaseEntry {
return createAnnotation(this.id, key);
}

createReplyContent(msgtype, body) {
return createReplyContent(this, msgtype, body);
createReplyContent(msgtype, body, permaLink) {
return createReplyContent(this, msgtype, body, permaLink);
}

/** takes both remote event id and local txn id into account, see overriding in PendingEventEntry */
Expand Down
3 changes: 2 additions & 1 deletion src/matrix/room/timeline/entries/reply.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright 2021 The Matrix.org Foundation C.I.C.
Copyright 2024 Mirian Margiani <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -50,7 +51,7 @@ function _createReplyContent(targetId, msgtype, body, formattedBody) {
};
}

export function createReplyContent(entry, msgtype, body) {
export function createReplyContent(entry, msgtype, body, permaLink) {
// TODO check for absense of sender / body / msgtype / etc?
const nonTextual = fallbackForNonTextualMessage(entry.content.msgtype);
const prefix = fallbackPrefix(entry.content.msgtype);
Expand Down

0 comments on commit 72d80fa

Please sign in to comment.