do self membership checks with getMyMembership elsewhere as well

This commit is contained in:
Bruno Windels
2018-08-22 14:06:28 +02:00
parent c38b286e8e
commit 860c6355f0
3 changed files with 10 additions and 13 deletions
+2 -3
View File
@@ -497,12 +497,11 @@ function canSendEvent(event, roomId) {
sendError(event, _t('This room is not recognised.'));
return;
}
const me = client.credentials.userId;
const member = room.getMember(me);
if (!member || member.membership !== "join") {
if (room.getMyMembership() !== "join") {
sendError(event, _t('You are not in this room.'));
return;
}
const me = client.credentials.userId;
let canSend = false;
if (isState) {