You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fluffychat/lib/pangea/extensions/room_space_settings_extensi...

38 lines
967 B
Dart

part of "pangea_room_extension.dart";
extension SpaceRoomExtension on Room {
String? get classCode {
final roomJoinRules = getState(EventTypes.RoomJoinRules, "");
if (roomJoinRules != null) {
final accessCode = roomJoinRules.content.tryGet(ModelKey.accessCode);
if (accessCode is String) {
return accessCode;
}
}
return null;
}
void checkClass() {
if (!isSpace) {
debugger(when: kDebugMode);
Sentry.addBreadcrumb(
Breadcrumb(message: "calling room.students with non-class room"),
);
}
}
Future<List<User>> get teachers async {
checkClass();
final List<User> participants = await requestParticipants();
return isSpace
? participants
.where(
(e) =>
e.powerLevel == SpaceConstants.powerLevelOfAdmin &&
e.id != BotName.byEnvironment,
)
.toList()
: participants;
}
}