You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-05 17:02:07 +03:00
add unstableClientRelationReplacements in js-sdk
This commit is contained in:
@@ -99,6 +99,11 @@ function synthesizeReceipt(userId, event, receiptType) {
|
||||
* via `EventTimelineSet#getRelationsForEvent`.
|
||||
* This feature is currently unstable and the API may change without notice.
|
||||
*
|
||||
* @param {boolean} [opts.unstableClientRelationReplacements = false]
|
||||
* Optional. Set to true to enable client-side handling of m.replace event relations,
|
||||
* exposed through the `Room.replaceEvent` event.
|
||||
* This feature is currently unstable and the API may change without notice.
|
||||
*
|
||||
* @prop {string} roomId The ID of this room.
|
||||
* @prop {string} name The human-readable display name for this room.
|
||||
* @prop {Array<MatrixEvent>} timeline The live event timeline for this room,
|
||||
@@ -1027,7 +1032,7 @@ Room.prototype._addLiveEvent = function(event, duplicateStrategy) {
|
||||
// this may be needed to trigger an update.
|
||||
}
|
||||
|
||||
if (event.isReplacement()) {
|
||||
if (this._opts.unstableClientRelationReplacements && event.isReplacement()) {
|
||||
const replacedEventId = event.getOriginalId();
|
||||
const replacedEvent = replacedEventId &&
|
||||
this.getUnfilteredTimelineSet().tryReplaceEvent(replacedEventId, event);
|
||||
|
||||
Reference in New Issue
Block a user