fix: fix annoucement chat power levels (#5179)
This commit is contained in:
parent
55b36723c1
commit
2ecb12e66f
3 changed files with 12 additions and 3 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||
import '../../../config/app_config.dart';
|
||||
|
||||
class StateMessage extends StatelessWidget {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/pangea/chat/constants/default_power_level.dart';
|
||||
import 'package:fluffychat/pangea/spaces/space_constants.dart';
|
||||
|
||||
enum CourseDefaultChatsEnum {
|
||||
|
|
@ -26,4 +27,11 @@ enum CourseDefaultChatsEnum {
|
|||
CourseDefaultChatsEnum.introductions => l10n.introChatDesc,
|
||||
CourseDefaultChatsEnum.announcements => l10n.announcementsChatDesc,
|
||||
};
|
||||
|
||||
dynamic powerLevels(String userID) => switch (this) {
|
||||
CourseDefaultChatsEnum.introductions =>
|
||||
RoomDefaults.defaultPowerLevels(userID),
|
||||
CourseDefaultChatsEnum.announcements =>
|
||||
RoomDefaults.restrictedPowerLevels(userID),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ extension CoursePlanRoomExtension on Room {
|
|||
type: EventTypes.RoomAvatar,
|
||||
content: {'url': uploadURL},
|
||||
),
|
||||
RoomDefaults.defaultPowerLevels(client.userID!),
|
||||
type.powerLevels(client.userID!),
|
||||
await client.pangeaJoinRules(
|
||||
'knock_restricted',
|
||||
allow: [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue