chore: set group chat power levels manually (#2012)
* chore: set group chat power levels manually --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
b6a0868e35
commit
1669c9f967
3 changed files with 44 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ import 'package:fluffychat/config/app_config.dart';
|
|||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||
import 'package:fluffychat/pages/chat_list/chat_list_item.dart';
|
||||
import 'package:fluffychat/pages/chat_list/search_title.dart';
|
||||
import 'package:fluffychat/pangea/chat/constants/default_power_level.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/constants/pangea_room_types.dart';
|
||||
import 'package:fluffychat/pangea/extensions/pangea_room_extension.dart';
|
||||
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
|
||||
|
|
@ -396,6 +397,13 @@ class _SpaceViewState extends State<SpaceView> {
|
|||
preset: sdk.CreateRoomPreset.publicChat,
|
||||
visibility: sdk.Visibility.private,
|
||||
enableEncryption: false,
|
||||
initialState: [
|
||||
StateEvent(
|
||||
type: EventTypes.RoomPowerLevels,
|
||||
stateKey: '',
|
||||
content: defaultPowerLevels,
|
||||
),
|
||||
],
|
||||
// Pangea#
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import 'package:fluffychat/config/app_config.dart';
|
|||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||
import 'package:fluffychat/pages/new_group/new_group_view.dart';
|
||||
import 'package:fluffychat/pangea/bot/utils/bot_name.dart';
|
||||
import 'package:fluffychat/pangea/chat/constants/default_power_level.dart';
|
||||
import 'package:fluffychat/pangea/common/constants/model_keys.dart';
|
||||
import 'package:fluffychat/pangea/common/utils/error_handler.dart';
|
||||
import 'package:fluffychat/pangea/common/utils/firebase_analytics.dart';
|
||||
|
|
@ -98,6 +99,13 @@ class NewGroupController extends State<NewGroup> {
|
|||
type: sdk.EventTypes.RoomAvatar,
|
||||
content: {'url': avatarUrl.toString()},
|
||||
),
|
||||
// #Pangea
|
||||
StateEvent(
|
||||
type: EventTypes.RoomPowerLevels,
|
||||
stateKey: '',
|
||||
content: defaultPowerLevels,
|
||||
),
|
||||
// Pangea#
|
||||
],
|
||||
// #Pangea
|
||||
enableEncryption: false,
|
||||
|
|
|
|||
28
lib/pangea/chat/constants/default_power_level.dart
Normal file
28
lib/pangea/chat/constants/default_power_level.dart
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
Map<String, dynamic> defaultPowerLevels = {
|
||||
"defaults": {
|
||||
"ban": 50,
|
||||
"events_default": 0,
|
||||
"invite": 50,
|
||||
"kick": 50,
|
||||
"notifications": {
|
||||
"room": 50,
|
||||
},
|
||||
"redact": 50,
|
||||
"state_default": 50,
|
||||
"users_default": 0,
|
||||
},
|
||||
"events": {
|
||||
"m.room.avatar": 50,
|
||||
"m.room.canonical_alias": 50,
|
||||
"m.room.encryption": 100,
|
||||
"m.room.history_visibility": 100,
|
||||
"m.room.name": 50,
|
||||
"m.room.power_levels": 100,
|
||||
"m.room.server_acl": 100,
|
||||
"m.room.tombstone": 100,
|
||||
},
|
||||
"users": {
|
||||
"@bot:staging.pangea.chat": 50,
|
||||
"@test_12_6_2:staging.pangea.chat": 100,
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Reference in a new issue