handle bot commands from unencrypted messages

This commit is contained in:
Sharon Kennedy 2020-03-26 18:24:53 -04:00
parent 6389210cf3
commit e37502972c

View File

@ -364,7 +364,8 @@ class OcrccBot {
});
}
// When a facilitator joins a support session, revoke the other invitations
// When a facilitator joins a support session, make them a moderator
// revoke the other invitations
if (
member.membership === "join" &&
member.userId !== process.env.BOT_USERID &&
@ -439,13 +440,12 @@ class OcrccBot {
});
// unencrypted messages
this.client.on("Room.timeline", (event, room, toStartOfTimeline) => {
if (
event.getType() === "m.room.message" &&
!this.client.isCryptoEnabled()
) {
if (event.isEncrypted()) {
return;
if (event.getType() === "m.room.message") {
logger.log("info", event);
logger.log("info", this.client.isCryptoEnabled());
logger.log("info", event.isEncrypted());
}
if (event.getType() === "m.room.message" && !event.isEncrypted()) {
this.handleMessageEvent(event);
}
});