Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Analytics #128

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3949,5 +3949,6 @@
}
},
"kickBotWarning": "Kicking Pangea Bot will remove the conversation bot from this chat.",
"joinToView": "Join this room to view details",
"refresh": "Refresh"
}
3 changes: 0 additions & 3 deletions lib/pages/chat/events/audio_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
});
_playAction();
} catch (e, s) {
// #Pangea
debugger();
// Pangea#
Logs().v('Could not download audio file', e, s);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
Expand Down
9 changes: 7 additions & 2 deletions lib/pages/chat_list/client_chooser_button.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:developer';

import 'package:adaptive_dialog/adaptive_dialog.dart';
import 'package:fluffychat/pangea/constants/class_default_values.dart';
import 'package:fluffychat/pangea/extensions/client_extension.dart';
import 'package:fluffychat/pangea/utils/class_code.dart';
import 'package:fluffychat/pangea/utils/find_conversation_partner_dialog.dart';
Expand Down Expand Up @@ -57,7 +58,11 @@ class ClientChooserButton extends StatelessWidget {
),
),
PopupMenuItem(
enabled: matrix.client.classesAndExchangesImTeaching.isNotEmpty,
enabled: matrix.client.rooms.any(
(room) =>
room.isSpace &&
room.ownPowerLevel >= ClassDefaultValues.powerLevelOfAdmin,
),
value: SettingsAction.classAnalytics,
child: Row(
children: [
Expand All @@ -68,7 +73,7 @@ class ClientChooserButton extends StatelessWidget {
),
),
PopupMenuItem(
enabled: matrix.client.classesImIn.isNotEmpty,
enabled: matrix.client.classesAndExchangesImIn.isNotEmpty,
value: SettingsAction.myAnalytics,
child: Row(
children: [
Expand Down
25 changes: 20 additions & 5 deletions lib/pages/new_space/new_space_view.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pangea/extensions/client_extension.dart';
import 'package:fluffychat/pangea/models/class_model.dart';
import 'package:fluffychat/pangea/pages/class_settings/p_class_widgets/room_rules_editor.dart';
import 'package:fluffychat/pangea/widgets/class/add_class_and_invite.dart';
import 'package:fluffychat/pangea/widgets/class/add_space_toggles.dart';
Expand Down Expand Up @@ -142,11 +143,25 @@ class NewSpaceView extends StatelessWidget {
? AddToClassMode.exchange
: AddToClassMode.chat,
),
RoomRulesEditor(
key: controller.rulesEditorKey,
roomId: null,
startOpen: false,
initialRules: Matrix.of(context).client.lastUpdatedRoomRules,
FutureBuilder<PangeaRoomRules?>(
future: Matrix.of(context).client.lastUpdatedRoomRules,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return RoomRulesEditor(
key: controller.rulesEditorKey,
roomId: null,
startOpen: false,
initialRules: snapshot.data,
);
} else {
return const Padding(
padding: EdgeInsets.all(16.0),
child: Center(
child: CircularProgressIndicator.adaptive(strokeWidth: 2),
),
);
}
},
),
// SwitchListTile.adaptive(
// title: Text(L10n.of(context)!.spaceIsPublic),
Expand Down
4 changes: 2 additions & 2 deletions lib/pangea/controllers/class_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class ClassController extends BaseController {
Future<void> fixClassPowerLevels() async {
try {
final List<Future<void>> classFixes = [];
for (final room in _pangeaController
.matrixState.client.classesAndExchangesImTeaching) {
for (final room in (await _pangeaController
.matrixState.client.classesAndExchangesImTeaching)) {
classFixes.add(room.setClassPowerlLevels());
}
await Future.wait(classFixes);
Expand Down
Loading
Loading