iterate PR based on feedback

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2019-07-29 22:30:07 +01:00
parent fd039431bc
commit 883b3d1563

View file

@ -37,10 +37,14 @@ export default class MessageActionBar extends React.PureComponent {
onFocusChange: PropTypes.func,
};
state = {
canReact: true,
canReply: true,
};
constructor(props, context) {
super(props, context);
this.state = {
canReact: true,
canReply: true,
};
}
componentDidMount() {
this.props.mxEvent.on("Event.decrypted", this.onDecrypted);
@ -65,7 +69,7 @@ export default class MessageActionBar extends React.PureComponent {
const cli = MatrixClientPeg.get();
const room = cli.getRoom(this.props.mxEvent.getRoomId());
if (room) {
const me = cli.credentials.userId;
const me = cli.getUserId();
const canReact = room.getMyMembership() === "join" && room.currentState.maySendEvent("m.reaction", me);
const canReply = room.maySendMessage();