Adapt Membership usage for the change to an enum KnownMembership

This commit is contained in:
Andy Balaam 2024-03-12 14:52:54 +00:00
parent da99bad7b9
commit 34559d2a89
115 changed files with 764 additions and 593 deletions

View file

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MatrixClient, Room } from "matrix-js-sdk/src/matrix";
import { KnownMembership, MatrixClient, Room } from "matrix-js-sdk/src/matrix";
import DMRoomMap from "../DMRoomMap";
import { isLocalRoom } from "../localRoom/isLocalRoom";
@ -42,7 +42,7 @@ function extractSuitableRoom(rooms: Room[], userId: string, findRoomWithThirdpar
// a DM is a room of two people that contains those two people exactly. This does mean
// that bots, assistants, etc will ruin a room's DM-ness, though this is a problem for
// canonical DMs to solve.
if (r && r.getMyMembership() === Membership.Join) {
if (r && r.getMyMembership() === KnownMembership.Join) {
if (isLocalRoom(r)) return false;
const functionalUsers = getFunctionalMembers(r);