feat: Phase 3 — E2EE calls, Jitsi conferencing, help tab, web security model

- LiveKit call E2EE: CallE2EEManager exchanges encryption keys via Matrix
  to-device events (m.rtc.encryption_keys) for interop with Element X
- Olm bootstrapped in index.html before Flutter init; main.dart logs result
- Encrypted messages shown with lock icon and informative fallback text
- Profile screen: key restore dialog + security setup (cross-signing/backup)
- Jitsi feature: welcome screen (public, no login), conference tab, full-screen
  embed via JitsiMeetExternalAPI, JitsiLink parser for all common link formats
- Help tab: expandable cards for encryption, video calls, account management
- Web security model: no session persistence — device ID only across visits
- Media auth: MSC3916 authenticated endpoint for avatars (Synapse 1.120+)
- Router: welcome route as public landing page; jitsi route as public
- Manifest/index.html: M8Chat branding, dark theme colours

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 05:28:14 +10:00
parent a241d0a7ab
commit b95471b0b4
27 changed files with 2076 additions and 226 deletions

View File

@@ -1,4 +1,4 @@
// Version: 1.1.0 | Created: 2026-04-01 | Updated: 2026-04-02
// Version: 1.4.0 | Created: 2026-04-01 | Updated: 2026-04-11
// Profile screen. Shows current user info and logout button.
import 'package:flutter/material.dart';
@@ -10,6 +10,8 @@ import '../../../core/config/app_config.dart';
import '../../../core/network/matrix_client.dart';
import '../../../shared/utils/matrix_id.dart';
import '../../../shared/widgets/matrix_avatar.dart';
import 'key_restore_dialog.dart';
import 'security_setup_dialog.dart';
class ProfileScreen extends ConsumerWidget {
const ProfileScreen({super.key, this.embedded = false});
@@ -85,14 +87,57 @@ class ProfileScreen extends ConsumerWidget {
ListTile(
leading: const Icon(Icons.lock_outline),
title: const Text('End-to-end encryption'),
subtitle: const Text('Setup coming in Phase 3'),
subtitle: Text(
client.encryptionEnabled
? 'Active — messages are encrypted'
: 'Not available in this browser',
),
enabled: false,
),
ListTile(
leading: const Icon(Icons.verified_user_outlined),
title: const Text('Verify devices'),
subtitle: const Text('Cross-signing setup — coming in Phase 2'),
enabled: false,
leading: const Icon(Icons.key_outlined),
title: const Text('Restore message keys'),
subtitle: const Text(
'Enter your recovery key to decrypt old messages',
),
enabled: client.encryptionEnabled,
onTap: client.encryptionEnabled
? () async {
final restored =
await showKeyRestoreDialog(context, client);
if (restored && context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Keys restored — reopen rooms '
'to see decrypted messages.'),
),
);
}
}
: null,
),
ListTile(
leading: const Icon(Icons.shield_outlined),
title: const Text('Security setup'),
subtitle: Text(
client.encryption?.crossSigning.enabled == true
? 'Cross-signing active — device verified'
: 'Set up cross-signing and key backup',
),
enabled: client.encryptionEnabled,
onTap: client.encryptionEnabled
? () async {
final completed =
await showSecuritySetupDialog(context, client);
if (completed && context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Security setup complete.'),
),
);
}
}
: null,
),
ListTile(
leading: const Icon(Icons.password_outlined),