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 ( if (
member.membership === "join" && member.membership === "join" &&
member.userId !== process.env.BOT_USERID && member.userId !== process.env.BOT_USERID &&
@ -439,13 +440,12 @@ class OcrccBot {
}); });
// unencrypted messages // unencrypted messages
this.client.on("Room.timeline", (event, room, toStartOfTimeline) => { this.client.on("Room.timeline", (event, room, toStartOfTimeline) => {
if ( if (event.getType() === "m.room.message") {
event.getType() === "m.room.message" && logger.log("info", event);
!this.client.isCryptoEnabled() logger.log("info", this.client.isCryptoEnabled());
) { logger.log("info", event.isEncrypted());
if (event.isEncrypted()) {
return;
} }
if (event.getType() === "m.room.message" && !event.isEncrypted()) {
this.handleMessageEvent(event); this.handleMessageEvent(event);
} }
}); });