Disable redacting reactions if we don't have sufficient permissions (#8767)

This commit is contained in:
Šimon Brandner 2022-06-10 20:41:05 +02:00 committed by GitHub
parent 3f99f594de
commit 9b8b1d193e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 37 additions and 9 deletions

View file

@ -183,7 +183,10 @@ export default class ReactionsRow extends React.PureComponent<IProps, IState> {
mxEvent={mxEvent}
reactionEvents={events}
myReactionEvent={myReactionEvent}
disabled={!this.context.canReact}
disabled={
!this.context.canReact ||
(myReactionEvent && !myReactionEvent.isRedacted() && !this.context.canSelfRedact)
}
/>;
}).filter(item => !!item);

View file

@ -47,6 +47,7 @@ interface IState {
export default class ReactionsRowButton extends React.PureComponent<IProps, IState> {
static contextType = MatrixClientContext;
public context!: React.ContextType<typeof MatrixClientContext>;
state = {
tooltipRendered: false,