You've already forked element-web
mirror of
https://github.com/element-hq/element-web.git
synced 2025-11-29 21:23:11 +03:00
Disable redacting reactions if we don't have sufficient permissions (#8767)
This commit is contained in:
@@ -169,6 +169,7 @@ export interface IRoomState {
|
||||
searchInProgress?: boolean;
|
||||
callState?: CallState;
|
||||
canPeek: boolean;
|
||||
canSelfRedact: boolean;
|
||||
showApps: boolean;
|
||||
isPeeking: boolean;
|
||||
showRightPanel: boolean;
|
||||
@@ -252,6 +253,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
searchResults: null,
|
||||
callState: null,
|
||||
canPeek: false,
|
||||
canSelfRedact: false,
|
||||
showApps: false,
|
||||
isPeeking: false,
|
||||
showRightPanel: false,
|
||||
@@ -1173,10 +1175,14 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
private updatePermissions(room: Room) {
|
||||
if (room) {
|
||||
const me = this.context.getUserId();
|
||||
const canReact = room.getMyMembership() === "join" && room.currentState.maySendEvent("m.reaction", me);
|
||||
const canReact = (
|
||||
room.getMyMembership() === "join" &&
|
||||
room.currentState.maySendEvent(EventType.Reaction, me)
|
||||
);
|
||||
const canSendMessages = room.maySendMessage();
|
||||
const canSelfRedact = room.currentState.maySendEvent(EventType.RoomRedaction, me);
|
||||
|
||||
this.setState({ canReact, canSendMessages });
|
||||
this.setState({ canReact, canSendMessages, canSelfRedact });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user