Always allow users to edit their user widgets.
This commit is contained in:
parent
b5320444a9
commit
8e1ba6d139
2 changed files with 9 additions and 0 deletions
|
@ -274,6 +274,11 @@ export default class AppTile extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
_canUserModify() {
|
_canUserModify() {
|
||||||
|
// User widgets should always be modifiable by their creator
|
||||||
|
if (this.props.userWidget && MatrixClientPeg.get().credentials.userId === this.props.creatorUserId) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Check if the current user can modify widgets in the current room
|
||||||
return WidgetUtils.canUserModifyWidgets(this.props.room.roomId);
|
return WidgetUtils.canUserModifyWidgets(this.props.room.roomId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -698,6 +703,8 @@ AppTile.propTypes = {
|
||||||
// Optional function to be called on widget capability request
|
// Optional function to be called on widget capability request
|
||||||
// Called with an array of the requested capabilities
|
// Called with an array of the requested capabilities
|
||||||
onCapabilityRequest: PropTypes.func,
|
onCapabilityRequest: PropTypes.func,
|
||||||
|
// Is this an instance of a user widget
|
||||||
|
userWidget: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
AppTile.defaultProps = {
|
AppTile.defaultProps = {
|
||||||
|
@ -710,4 +717,5 @@ AppTile.defaultProps = {
|
||||||
showPopout: true,
|
showPopout: true,
|
||||||
handleMinimisePointerEvents: false,
|
handleMinimisePointerEvents: false,
|
||||||
whitelistCapabilities: [],
|
whitelistCapabilities: [],
|
||||||
|
userWidget: false,
|
||||||
};
|
};
|
||||||
|
|
|
@ -178,6 +178,7 @@ export default class Stickerpicker extends React.Component {
|
||||||
onMinimiseClick={this._onHideStickersClick}
|
onMinimiseClick={this._onHideStickersClick}
|
||||||
handleMinimisePointerEvents={true}
|
handleMinimisePointerEvents={true}
|
||||||
whitelistCapabilities={['m.sticker']}
|
whitelistCapabilities={['m.sticker']}
|
||||||
|
userWidget={true}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue