You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Code review
- use an empty state key - swap switch for if - s/not in view/not visible/
This commit is contained in:
@@ -196,7 +196,7 @@ function getMembershipState(event, roomId, userId) {
|
|||||||
|
|
||||||
function getJoinRules(event, roomId) {
|
function getJoinRules(event, roomId) {
|
||||||
console.log(`join_rules of ${roomId} requested.`);
|
console.log(`join_rules of ${roomId} requested.`);
|
||||||
returnStateEvent(event, roomId, "m.room.join_rules");
|
returnStateEvent(event, roomId, "m.room.join_rules", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
function botOptions(event, roomId, userId) {
|
function botOptions(event, roomId, userId) {
|
||||||
@@ -228,11 +228,10 @@ var currentRoomId = null;
|
|||||||
// Listen for when a room is viewed
|
// Listen for when a room is viewed
|
||||||
dis.register(onAction);
|
dis.register(onAction);
|
||||||
function onAction(payload) {
|
function onAction(payload) {
|
||||||
switch (payload.action) {
|
if (payload.action !== "view_room")
|
||||||
case 'view_room':
|
return;
|
||||||
currentRoomId = payload.room_id;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
currentRoomId = payload.room_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
const onMessage = function(event) {
|
const onMessage = function(event) {
|
||||||
@@ -265,7 +264,7 @@ const onMessage = function(event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (roomId !== currentRoomId) {
|
if (roomId !== currentRoomId) {
|
||||||
sendError(event, "Room " + roomId + " not in view");
|
sendError(event, "Room " + roomId + " not visible");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user