forked from element-hq/hydrogen-web
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass message permalink to createReplyContent()
Signed-off-by: Mirian Margiani <[email protected]>
- Loading branch information
1 parent
c6c6ee7
commit 72d80fa
Showing
3 changed files
with
7 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
@@ -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) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
@@ -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 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
@@ -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); | ||
|