fix: in new courses, set course_user state event power level to 0 (#3882)
This commit is contained in:
parent
6bf699c190
commit
19381d0fd7
5 changed files with 25 additions and 8 deletions
|
|
@ -339,7 +339,11 @@ class ChatView extends StatelessWidget {
|
|||
child: ChatEventList(controller: controller),
|
||||
),
|
||||
),
|
||||
if (controller.showScrollDownButton)
|
||||
// #Pangea
|
||||
// if (controller.showScrollDownButton)
|
||||
if (controller.showScrollDownButton &&
|
||||
!controller.room.showActivityFinished)
|
||||
// Pangea#
|
||||
Divider(
|
||||
height: 1,
|
||||
color: theme.dividerColor,
|
||||
|
|
@ -354,8 +358,13 @@ class ChatView extends StatelessWidget {
|
|||
onPressed: controller.goToNewRoomAction,
|
||||
),
|
||||
)
|
||||
// #Pangea
|
||||
// else if (controller.room.canSendDefaultMessages &&
|
||||
// controller.room.membership == Membership.join)
|
||||
else if (controller.room.canSendDefaultMessages &&
|
||||
controller.room.membership == Membership.join)
|
||||
controller.room.membership == Membership.join &&
|
||||
!controller.room.showActivityFinished)
|
||||
// Pangea#
|
||||
Container(
|
||||
margin: EdgeInsets.all(bottomSheetPadding),
|
||||
constraints: const BoxConstraints(
|
||||
|
|
|
|||
|
|
@ -50,7 +50,12 @@ class ChatPermissionsSettingsView extends StatelessWidget {
|
|||
controller.defaultPowerLevels,
|
||||
);
|
||||
|
||||
final excludedEvents = [PangeaEventTypes.activityRole];
|
||||
final excludedEvents = [
|
||||
PangeaEventTypes.activityRole,
|
||||
PangeaEventTypes.activitySummary,
|
||||
PangeaEventTypes.coursePlan,
|
||||
PangeaEventTypes.courseUser,
|
||||
];
|
||||
|
||||
Map<String, dynamic> missingPowerLevels = Map<String, dynamic>.from(
|
||||
defaults,
|
||||
|
|
|
|||
|
|
@ -329,6 +329,9 @@ extension ActivityRoomExtension on Room {
|
|||
|
||||
bool get isActivitySession => isActivityRoomType || activityPlan != null;
|
||||
|
||||
bool get showActivityFinished =>
|
||||
showActivityChatUI && ownRole != null && hasCompletedActivity;
|
||||
|
||||
Future<ActivitySummaryAnalyticsModel> getActivityAnalytics() async {
|
||||
// wait for local storage box to init in getAnalytics initialization
|
||||
if (!MatrixState.pangeaController.getAnalytics.initCompleter.isCompleted) {
|
||||
|
|
|
|||
|
|
@ -76,9 +76,7 @@ class ActivityFinishedStatusMessage extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!controller.room.showActivityChatUI ||
|
||||
controller.room.ownRole == null ||
|
||||
!controller.room.hasCompletedActivity) {
|
||||
if (!controller.room.showActivityFinished) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +84,6 @@ class ActivityFinishedStatusMessage extends StatelessWidget {
|
|||
return AnimatedSize(
|
||||
duration: FluffyThemes.animationDuration,
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(top: 20.0),
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surface,
|
||||
|
|
@ -96,7 +93,9 @@ class ActivityFinishedStatusMessage extends StatelessWidget {
|
|||
),
|
||||
child: Center(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 400),
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 400,
|
||||
),
|
||||
child: Column(
|
||||
spacing: 12.0,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ class RoomDefaults {
|
|||
"invite": 50,
|
||||
"redact": 50,
|
||||
"events": {
|
||||
PangeaEventTypes.courseUser: 100,
|
||||
"m.room.power_levels": 100,
|
||||
"m.room.join_rules": 100,
|
||||
"m.space.child": spaceChild,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue