You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-14 19:22:15 +03:00
Consider cases where the sender may not redact their own event
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
@@ -258,7 +258,11 @@ RoomState.prototype.maySendRedactionForEvent = function(mxEvent, userId) {
|
||||
if (!member || member.membership === 'leave') return false;
|
||||
|
||||
if (mxEvent.status || mxEvent.isRedacted()) return false;
|
||||
if (mxEvent.getSender() === userId) return true;
|
||||
|
||||
// The user may have been the sender, but they can't redact their own message
|
||||
// if redactions are blocked.
|
||||
const canRedact = this.maySendEvent("m.room.redaction", userId);
|
||||
if (mxEvent.getSender() === userId) return canRedact;
|
||||
|
||||
return this._hasSufficientPowerLevelFor('redact', member.powerLevel);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user