File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1461,7 +1461,7 @@ describe("Room", function() {
1461
1461
describe ( "maySendMessage" , function ( ) {
1462
1462
it ( "should return false if synced membership not join" ,
1463
1463
function ( ) {
1464
- const room = new Room ( roomId , null , userA ) ;
1464
+ const room = new Room ( roomId , { isRoomEncrypted : ( ) => false } , userA ) ;
1465
1465
room . updateMyMembership ( "invite" ) ;
1466
1466
expect ( room . maySendMessage ( ) ) . toEqual ( false ) ;
1467
1467
room . updateMyMembership ( "leave" ) ;
Original file line number Diff line number Diff line change @@ -2199,8 +2199,9 @@ export class Room extends EventEmitter {
2199
2199
* message events into the room.
2200
2200
*/
2201
2201
public maySendMessage ( ) : boolean {
2202
- return this . getMyMembership ( ) === 'join' &&
2203
- this . currentState . maySendEvent ( EventType . RoomMessage , this . myUserId ) ;
2202
+ return this . getMyMembership ( ) === 'join' && ( this . client . isRoomEncrypted ( this . roomId )
2203
+ ? this . currentState . maySendEvent ( EventType . RoomMessageEncrypted , this . myUserId )
2204
+ : this . currentState . maySendEvent ( EventType . RoomMessage , this . myUserId ) ) ;
2204
2205
}
2205
2206
2206
2207
/**
You can’t perform that action at this time.
0 commit comments