chore: add permission to send activity events to newly created chats (#2923)
This commit is contained in:
parent
0aa9a3f195
commit
583479873d
4 changed files with 13 additions and 3 deletions
|
|
@ -4976,5 +4976,6 @@
|
|||
"canBeFoundViaCodeOrLink": "\u2022 code or link",
|
||||
"canBeFoundViaKnock": "\u2022 request to join and admin approval",
|
||||
"anyoneCanJoin": "Anyone can join! However, admin can kick and ban whoever misbehaves. Those who are banned may not return!",
|
||||
"createYourSpace": "Create your space"
|
||||
"createYourSpace": "Create your space",
|
||||
"sendActivities": "Send activities"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/pangea/events/constants/pangea_event_types.dart';
|
||||
|
||||
class PermissionsListTile extends StatelessWidget {
|
||||
final String permissionKey;
|
||||
|
|
@ -100,6 +101,8 @@ class PermissionsListTile extends StatelessWidget {
|
|||
return L10n.of(context).pinMessages;
|
||||
case EventTypes.RoomJoinRules:
|
||||
return L10n.of(context).setJoinRules;
|
||||
case PangeaEventTypes.activityPlan:
|
||||
return L10n.of(context).sendActivities;
|
||||
// Pangea#
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/pangea/events/constants/pangea_event_types.dart';
|
||||
|
||||
class RoomDefaults {
|
||||
static StateEvent defaultPowerLevels(String userID) => StateEvent(
|
||||
type: EventTypes.RoomPowerLevels,
|
||||
|
|
@ -10,6 +12,7 @@ class RoomDefaults {
|
|||
"invite": 50,
|
||||
"redact": 50,
|
||||
"events": {
|
||||
PangeaEventTypes.activityPlan: 0,
|
||||
"m.room.power_levels": 100,
|
||||
"m.room.pinned_events": 50,
|
||||
},
|
||||
|
|
@ -34,6 +37,7 @@ class RoomDefaults {
|
|||
"invite": 50,
|
||||
"redact": 50,
|
||||
"events": {
|
||||
PangeaEventTypes.activityPlan: 50,
|
||||
"m.room.power_levels": 100,
|
||||
"m.room.pinned_events": 50,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import 'package:fluffychat/pangea/chat_settings/models/bot_options_model.dart';
|
|||
import 'package:fluffychat/pangea/chat_settings/utils/delete_room.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/widgets/conversation_bot/conversation_bot_settings.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/widgets/delete_space_dialog.dart';
|
||||
import 'package:fluffychat/pangea/events/constants/pangea_event_types.dart';
|
||||
import 'package:fluffychat/pangea/extensions/pangea_room_extension.dart';
|
||||
import 'package:fluffychat/pangea/spaces/utils/load_participants_util.dart';
|
||||
import 'package:fluffychat/pangea/spaces/widgets/download_space_analytics_dialog.dart';
|
||||
|
|
@ -316,8 +317,9 @@ class RoomDetailsButtonRowState extends State<RoomDetailsButtonRow> {
|
|||
title: l10n.activities,
|
||||
icon: const Icon(Icons.event_note_outlined),
|
||||
onPressed: () => context.go("/rooms/${room.id}/details/planner"),
|
||||
visible: room.canSendDefaultStates || room.isSpace,
|
||||
enabled: room.canSendDefaultStates,
|
||||
visible: room.canChangeStateEvent(PangeaEventTypes.activityPlan) ||
|
||||
room.isSpace,
|
||||
enabled: room.canChangeStateEvent(PangeaEventTypes.activityPlan),
|
||||
),
|
||||
ButtonDetails(
|
||||
title: l10n.permissions,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue