fix(relay): secure reconnect and room ownership

This commit is contained in:
edde746
2026-07-24 03:46:50 +02:00
parent e0bf66eea8
commit 43a8fe020d
82 changed files with 12341 additions and 1382 deletions
+28 -15
View File
@@ -58,7 +58,9 @@ String constrainLogUploadPayload({required String header, required String logs,
}
class LogsScreen extends StatefulWidget {
const LogsScreen({super.key});
const LogsScreen({super.key, this.httpClient});
final MediaServerHttpClient? httpClient;
@override
State<LogsScreen> createState() => _LogsScreenState();
@@ -69,6 +71,8 @@ class _LogsScreenState extends State<LogsScreen> with MountedSetStateMixin {
String _deviceInfo = '';
final ScrollController _scrollController = ScrollController();
MediaServerHttpClient get _httpClient => widget.httpClient ?? httpClient;
@override
void initState() {
super.initState();
@@ -182,7 +186,7 @@ class _LogsScreenState extends State<LogsScreen> with MountedSetStateMixin {
showLoadingDialog(context);
try {
final response = await httpClient.post(
final response = await _httpClient.post(
'https://ice.plezy.app/logs',
body: logText,
headers: {'Content-Type': 'text/plain'},
@@ -199,20 +203,29 @@ class _LogsScreenState extends State<LogsScreen> with MountedSetStateMixin {
context: context,
builder: (ctx) => AlertDialog(
title: Text(t.messages.logsUploaded),
content: Row(
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('${t.messages.logId}: '),
SelectableText(
id,
style: const TextStyle(fontWeight: .bold, fontFamily: 'monospace', fontSize: 18),
),
const SizedBox(width: 8),
IconButton(
icon: const AppIcon(Symbols.content_copy_rounded, size: 20),
onPressed: () {
Clipboard.setData(ClipboardData(text: id));
showSuccessSnackBar(context, t.messages.logsCopied);
},
Text('${t.messages.logId}:'),
const SizedBox(height: 8),
Row(
children: [
Expanded(
child: SelectableText(
id,
style: const TextStyle(fontWeight: .bold, fontFamily: 'monospace', fontSize: 18),
),
),
const SizedBox(width: 8),
IconButton(
icon: const AppIcon(Symbols.content_copy_rounded, size: 20),
onPressed: () {
Clipboard.setData(ClipboardData(text: id));
showSuccessSnackBar(context, t.messages.logsCopied);
},
),
],
),
],
),