refactor: print() durch debugPrint() ersetzen (avoid_print Lint)
65 flutter-analyze-Meldungen behoben, indem alle print()-Aufrufe in Core- Dateien (Push, LiveKit, Matrix-Client, VoIP, Screen-Share) durch das Flutter-eigene debugPrint() ersetzt wurden. Gleiche Funktion (Logging in Debug-Sessions), aber zeilenlängen-sicher und ohne Lint-Warnung. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1093,3 +1093,11 @@
|
|||||||
2026-07-03 06:24 [Edit] /home/steggi/pyramid/lib/core/background_push.dart
|
2026-07-03 06:24 [Edit] /home/steggi/pyramid/lib/core/background_push.dart
|
||||||
2026-07-03 06:24 [Edit] /home/steggi/pyramid/lib/core/background_push.dart
|
2026-07-03 06:24 [Edit] /home/steggi/pyramid/lib/core/background_push.dart
|
||||||
2026-07-03 06:24 [Edit] /home/steggi/pyramid/lib/core/livekit_call_manager.dart
|
2026-07-03 06:24 [Edit] /home/steggi/pyramid/lib/core/livekit_call_manager.dart
|
||||||
|
2026-07-03 06:26 [Write] /home/steggi/.claude/projects/-home-steggi-pyramid/memory/pyramid_push.md
|
||||||
|
2026-07-03 06:27 [Edit] /home/steggi/.claude/projects/-home-steggi-pyramid/memory/pyramid_push.md
|
||||||
|
2026-07-03 06:27 [Write] /home/steggi/.claude/projects/-home-steggi-pyramid/memory/MEMORY.md
|
||||||
|
2026-07-03 06:28 [Edit] /home/steggi/pyramid/lib/core/livekit_call_manager.dart
|
||||||
|
2026-07-03 06:28 [Edit] /home/steggi/pyramid/lib/core/notification_service.dart
|
||||||
|
2026-07-03 06:29 [Edit] /home/steggi/pyramid/lib/core/background_push.dart
|
||||||
|
2026-07-03 06:29 [Edit] /home/steggi/pyramid/lib/core/background_push.dart
|
||||||
|
2026-07-03 06:29 [Edit] /home/steggi/pyramid/lib/core/voip_manager.dart
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ void notificationEngineMain() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[NOTIF-BGENGINE] handler error: $e');
|
debugPrint('[NOTIF-BGENGINE] handler error: $e');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@@ -111,7 +111,7 @@ Future<bool> _bgDecryptAndShow(String? roomId, String? eventId, int? notifId) as
|
|||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[NOTIF-BGENGINE] decryptAndShow error: $e');
|
debugPrint('[NOTIF-BGENGINE] decryptAndShow error: $e');
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
// Let the async key-backup upload settle before closing the DB — otherwise
|
// Let the async key-backup upload settle before closing the DB — otherwise
|
||||||
@@ -138,10 +138,10 @@ Future<bool> _bgSendReply(String? roomId, String? text) async {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
await room.sendTextEvent(text.trim());
|
await room.sendTextEvent(text.trim());
|
||||||
print('[NOTIF-BGENGINE] encrypted reply sent to $roomId');
|
debugPrint('[NOTIF-BGENGINE] encrypted reply sent to $roomId');
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[NOTIF-BGENGINE] sendReply error: $e');
|
debugPrint('[NOTIF-BGENGINE] sendReply error: $e');
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
await prefs.setString('notif_pending_reply_room', roomId);
|
await prefs.setString('notif_pending_reply_room', roomId);
|
||||||
await prefs.setString('notif_pending_reply_text', text);
|
await prefs.setString('notif_pending_reply_text', text);
|
||||||
@@ -163,7 +163,7 @@ Future<void> registerBgEngineHandle() async {
|
|||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
await prefs.setInt('bg_engine_handle', handle.toRawHandle());
|
await prefs.setInt('bg_engine_handle', handle.toRawHandle());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[NOTIF-BGENGINE] registerBgEngineHandle failed: $e');
|
debugPrint('[NOTIF-BGENGINE] registerBgEngineHandle failed: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ Future<Client?> _buildClient() async {
|
|||||||
|
|
||||||
return client;
|
return client;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[NOTIF-BGENGINE] _buildClient failed: $e');
|
debugPrint('[NOTIF-BGENGINE] _buildClient failed: $e');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -241,8 +241,8 @@ Future<void> handleBackgroundNotificationResponse(
|
|||||||
NotificationResponse details) async {
|
NotificationResponse details) async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
print('[NOTIF-BG] handleBackgroundNotificationResponse fired');
|
debugPrint('[NOTIF-BG] handleBackgroundNotificationResponse fired');
|
||||||
print('[NOTIF-BG] actionId=${details.actionId} payload=${details.payload} input=${details.input} id=${details.id}');
|
debugPrint('[NOTIF-BG] actionId=${details.actionId} payload=${details.payload} input=${details.input} id=${details.id}');
|
||||||
|
|
||||||
// ── Fast path: main isolate is running ───────────────────────────────────
|
// ── Fast path: main isolate is running ───────────────────────────────────
|
||||||
// If the Pyramid UI process is alive (app is backgrounded but not killed),
|
// If the Pyramid UI process is alive (app is backgrounded but not killed),
|
||||||
@@ -250,7 +250,7 @@ Future<void> handleBackgroundNotificationResponse(
|
|||||||
// any new engine and works silently without bringing the app to foreground.
|
// any new engine and works silently without bringing the app to foreground.
|
||||||
final sendPort = IsolateNameServer.lookupPortByName(kMainIsolateName);
|
final sendPort = IsolateNameServer.lookupPortByName(kMainIsolateName);
|
||||||
if (sendPort != null) {
|
if (sendPort != null) {
|
||||||
print('[NOTIF-BG] main isolate alive → forwarding via IsolateNameServer');
|
debugPrint('[NOTIF-BG] main isolate alive → forwarding via IsolateNameServer');
|
||||||
sendPort.send(<String, dynamic>{
|
sendPort.send(<String, dynamic>{
|
||||||
'actionId': details.actionId,
|
'actionId': details.actionId,
|
||||||
'payload': details.payload,
|
'payload': details.payload,
|
||||||
@@ -264,7 +264,7 @@ Future<void> handleBackgroundNotificationResponse(
|
|||||||
// Main isolate is gone. Dismiss the notification and, for reply actions,
|
// Main isolate is gone. Dismiss the notification and, for reply actions,
|
||||||
// persist the text in SharedPreferences so _sendPendingReply picks it up
|
// persist the text in SharedPreferences so _sendPendingReply picks it up
|
||||||
// the next time the app opens (via getInitialReply cold-start flow).
|
// the next time the app opens (via getInitialReply cold-start flow).
|
||||||
print('[NOTIF-BG] main isolate not running → SharedPreferences fallback');
|
debugPrint('[NOTIF-BG] main isolate not running → SharedPreferences fallback');
|
||||||
|
|
||||||
final plugin = FlutterLocalNotificationsPlugin();
|
final plugin = FlutterLocalNotificationsPlugin();
|
||||||
await plugin.initialize(
|
await plugin.initialize(
|
||||||
@@ -276,20 +276,20 @@ Future<void> handleBackgroundNotificationResponse(
|
|||||||
final roomId = details.payload;
|
final roomId = details.payload;
|
||||||
if (roomId != null) {
|
if (roomId != null) {
|
||||||
await plugin.cancel(_stableId(roomId));
|
await plugin.cancel(_stableId(roomId));
|
||||||
print('[NOTIF-BG] cancelled notification for room $roomId');
|
debugPrint('[NOTIF-BG] cancelled notification for room $roomId');
|
||||||
} else if (details.id != null) {
|
} else if (details.id != null) {
|
||||||
await plugin.cancel(details.id!);
|
await plugin.cancel(details.id!);
|
||||||
print('[NOTIF-BG] cancelled notification id ${details.id}');
|
debugPrint('[NOTIF-BG] cancelled notification id ${details.id}');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (details.actionId != 'reply') {
|
if (details.actionId != 'reply') {
|
||||||
print('[NOTIF-BG] not a reply action, done');
|
debugPrint('[NOTIF-BG] not a reply action, done');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final text = details.input?.trim() ?? '';
|
final text = details.input?.trim() ?? '';
|
||||||
if (text.isEmpty || roomId == null) {
|
if (text.isEmpty || roomId == null) {
|
||||||
print('[NOTIF-BG] text empty or roomId null, aborting');
|
debugPrint('[NOTIF-BG] text empty or roomId null, aborting');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,6 +297,6 @@ Future<void> handleBackgroundNotificationResponse(
|
|||||||
// _bgSendReply falls back to the prefs queue if it can't send (so the main app
|
// _bgSendReply falls back to the prefs queue if it can't send (so the main app
|
||||||
// delivers it on next launch).
|
// delivers it on next launch).
|
||||||
final sent = await _bgSendReply(roomId, text);
|
final sent = await _bgSendReply(roomId, text);
|
||||||
print('[NOTIF-BG] background reply sent=$sent room=$roomId');
|
debugPrint('[NOTIF-BG] background reply sent=$sent room=$roomId');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// ignore_for_file: avoid_print
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@@ -119,7 +118,7 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
await client.setRoomStateWithKey(roomId, _kVoicePresenceType, userId, content);
|
await client.setRoomStateWithKey(roomId, _kVoicePresenceType, userId, content);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[VoicePresence] $e');
|
debugPrint('[VoicePresence] $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,7 +184,7 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
.toList(),
|
.toList(),
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[LiveKit] ICE server fetch error: $e');
|
debugPrint('[LiveKit] ICE server fetch error: $e');
|
||||||
}
|
}
|
||||||
|
|
||||||
await room.connect(
|
await room.connect(
|
||||||
@@ -252,7 +251,7 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
final devices = await rtc.navigator.mediaDevices.enumerateDevices();
|
final devices = await rtc.navigator.mediaDevices.enumerateDevices();
|
||||||
deviceIds = devices.map((d) => d.deviceId).toSet();
|
deviceIds = devices.map((d) => d.deviceId).toSet();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[LiveKit] Device prefs/enumerate error: $e');
|
debugPrint('[LiveKit] Device prefs/enumerate error: $e');
|
||||||
}
|
}
|
||||||
if (prefMic != null && !deviceIds.contains(prefMic)) prefMic = null;
|
if (prefMic != null && !deviceIds.contains(prefMic)) prefMic = null;
|
||||||
if (prefSpeaker != null && !deviceIds.contains(prefSpeaker)) prefSpeaker = null;
|
if (prefSpeaker != null && !deviceIds.contains(prefSpeaker)) prefSpeaker = null;
|
||||||
@@ -268,7 +267,7 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
try {
|
try {
|
||||||
await rtc.Helper.selectAudioOutput(prefSpeaker);
|
await rtc.Helper.selectAudioOutput(prefSpeaker);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[LiveKit] selectAudioOutput error: $e');
|
debugPrint('[LiveKit] selectAudioOutput error: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,13 +281,13 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[LiveKit] Failed to enable camera: $e');
|
debugPrint('[LiveKit] Failed to enable camera: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_startStatsLogging();
|
_startStatsLogging();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[VOIP] Start call error: $e');
|
debugPrint('[VOIP] Start call error: $e');
|
||||||
isConnecting = false;
|
isConnecting = false;
|
||||||
error = e.toString();
|
error = e.toString();
|
||||||
_cleanUpAfterDisconnect();
|
_cleanUpAfterDisconnect();
|
||||||
@@ -325,7 +324,7 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setSubscribeQuality(String key) async {
|
Future<void> setSubscribeQuality(String key) async {
|
||||||
print('[LiveKit] Viewer changing subscribe quality to: $key');
|
debugPrint('[LiveKit] Viewer changing subscribe quality to: $key');
|
||||||
_subscribeQualityKey = key;
|
_subscribeQualityKey = key;
|
||||||
if (_room == null) { notifyListeners(); return; }
|
if (_room == null) { notifyListeners(); return; }
|
||||||
|
|
||||||
@@ -333,7 +332,7 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
for (final p in _room!.remoteParticipants.values) {
|
for (final p in _room!.remoteParticipants.values) {
|
||||||
for (final pub in p.videoTrackPublications) {
|
for (final pub in p.videoTrackPublications) {
|
||||||
if (pub.kind == TrackType.VIDEO) {
|
if (pub.kind == TrackType.VIDEO) {
|
||||||
print('[LiveKit] Setting subscription quality for ${p.identity} to $quality');
|
debugPrint('[LiveKit] Setting subscription quality for ${p.identity} to $quality');
|
||||||
pub.setVideoQuality(quality);
|
pub.setVideoQuality(quality);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -387,13 +386,13 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
);
|
);
|
||||||
isCameraOff = false;
|
isCameraOff = false;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[LiveKit] toggleCamera ON error: $e');
|
debugPrint('[LiveKit] toggleCamera ON error: $e');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
await _room?.localParticipant?.setCameraEnabled(false);
|
await _room?.localParticipant?.setCameraEnabled(false);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[LiveKit] toggleCamera OFF error: $e');
|
debugPrint('[LiveKit] toggleCamera OFF error: $e');
|
||||||
}
|
}
|
||||||
isCameraOff = true;
|
isCameraOff = true;
|
||||||
}
|
}
|
||||||
@@ -417,7 +416,7 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
isScreenSharing = true;
|
isScreenSharing = true;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[ScreenShare] Toggle error: $e');
|
debugPrint('[ScreenShare] Toggle error: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -455,7 +454,7 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
unawaited(_applyFpsToAllSimulcastLayers(track));
|
unawaited(_applyFpsToAllSimulcastLayers(track));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[ScreenShare] ERROR: $e');
|
debugPrint('[ScreenShare] ERROR: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -531,7 +530,7 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> changeQuality(String qualityKey) async {
|
Future<void> changeQuality(String qualityKey) async {
|
||||||
print('[LiveKit] Streamer changing publish quality to: $qualityKey');
|
debugPrint('[LiveKit] Streamer changing publish quality to: $qualityKey');
|
||||||
_localQualityKey = qualityKey;
|
_localQualityKey = qualityKey;
|
||||||
final params = qualityPresets[qualityKey];
|
final params = qualityPresets[qualityKey];
|
||||||
if (params == null) { notifyListeners(); return; }
|
if (params == null) { notifyListeners(); return; }
|
||||||
@@ -549,7 +548,7 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
cameraCaptureOptions: CameraCaptureOptions(params: params),
|
cameraCaptureOptions: CameraCaptureOptions(params: params),
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[LiveKit] Camera restart error: $e');
|
debugPrint('[LiveKit] Camera restart error: $e');
|
||||||
isCameraOff = true;
|
isCameraOff = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -573,7 +572,7 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
await participant.publishAudioTrack(track);
|
await participant.publishAudioTrack(track);
|
||||||
if (isMuted) await participant.setMicrophoneEnabled(false);
|
if (isMuted) await participant.setMicrophoneEnabled(false);
|
||||||
} catch (e) { print('[Audio] error: $e'); }
|
} catch (e) { debugPrint('[Audio] error: $e'); }
|
||||||
}
|
}
|
||||||
|
|
||||||
void setRemoteVolume(double volume) {
|
void setRemoteVolume(double volume) {
|
||||||
@@ -599,6 +598,6 @@ class LiveKitCallManager with ChangeNotifier {
|
|||||||
Future<void> _logStats() async {
|
Future<void> _logStats() async {
|
||||||
if (_room == null) return;
|
if (_room == null) return;
|
||||||
// Basic stats logging...
|
// Basic stats logging...
|
||||||
print('[Stats] SubQuality: $_subscribeQualityKey | PubQuality: $_localQualityKey');
|
debugPrint('[Stats] SubQuality: $_subscribeQualityKey | PubQuality: $_localQualityKey');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ final matrixClientProvider = FutureProvider<Client>((ref) async {
|
|||||||
await db.execute('PRAGMA journal_mode=WAL');
|
await db.execute('PRAGMA journal_mode=WAL');
|
||||||
await db.execute('PRAGMA busy_timeout = 5000');
|
await db.execute('PRAGMA busy_timeout = 5000');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (kDebugMode) print('Could not set PRAGMAs: $e');
|
if (kDebugMode) debugPrint('Could not set PRAGMAs: $e');
|
||||||
}
|
}
|
||||||
|
|
||||||
final sdkDb = await MatrixSdkDatabase.init('pyramid', database: db);
|
final sdkDb = await MatrixSdkDatabase.init('pyramid', database: db);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'dart:io';
|
|||||||
import 'dart:isolate';
|
import 'dart:isolate';
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
@@ -72,61 +73,61 @@ Future<void> _initAndroid(WidgetRef ref) async {
|
|||||||
IsolateNameServer.registerPortWithName(
|
IsolateNameServer.registerPortWithName(
|
||||||
_mainIsolatePort!.sendPort, kMainIsolateName);
|
_mainIsolatePort!.sendPort, kMainIsolateName);
|
||||||
_mainIsolatePort!.listen((msg) => _onIsolateMessage(msg, ref));
|
_mainIsolatePort!.listen((msg) => _onIsolateMessage(msg, ref));
|
||||||
print('[NOTIF] IsolateNameServer port registered: $kMainIsolateName');
|
debugPrint('[NOTIF] IsolateNameServer port registered: $kMainIsolateName');
|
||||||
|
|
||||||
await _androidPlugin.initialize(
|
await _androidPlugin.initialize(
|
||||||
const InitializationSettings(
|
const InitializationSettings(
|
||||||
android: AndroidInitializationSettings('@drawable/ic_notification'),
|
android: AndroidInitializationSettings('@drawable/ic_notification'),
|
||||||
),
|
),
|
||||||
onDidReceiveNotificationResponse: (details) {
|
onDidReceiveNotificationResponse: (details) {
|
||||||
print('[NOTIF-FG] onDidReceiveNotificationResponse fired');
|
debugPrint('[NOTIF-FG] onDidReceiveNotificationResponse fired');
|
||||||
print('[NOTIF-FG] actionId=${details.actionId} payload=${details.payload} input=${details.input}');
|
debugPrint('[NOTIF-FG] actionId=${details.actionId} payload=${details.payload} input=${details.input}');
|
||||||
if (details.actionId == 'reply') {
|
if (details.actionId == 'reply') {
|
||||||
final text = details.input?.trim() ?? '';
|
final text = details.input?.trim() ?? '';
|
||||||
final roomId = details.payload;
|
final roomId = details.payload;
|
||||||
print('[NOTIF-FG] reply: text="$text" roomId=$roomId');
|
debugPrint('[NOTIF-FG] reply: text="$text" roomId=$roomId');
|
||||||
if (text.isNotEmpty && roomId != null && roomId.isNotEmpty) {
|
if (text.isNotEmpty && roomId != null && roomId.isNotEmpty) {
|
||||||
_androidPlugin.cancel(_stableRoomId(roomId));
|
_androidPlugin.cancel(_stableRoomId(roomId));
|
||||||
ref.read(matrixClientProvider.future).then((client) async {
|
ref.read(matrixClientProvider.future).then((client) async {
|
||||||
final room = client.getRoomById(roomId);
|
final room = client.getRoomById(roomId);
|
||||||
print('[NOTIF-FG] getRoomById → ${room != null ? 'found' : 'null'}');
|
debugPrint('[NOTIF-FG] getRoomById → ${room != null ? 'found' : 'null'}');
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
try {
|
try {
|
||||||
await room.sendTextEvent(text);
|
await room.sendTextEvent(text);
|
||||||
print('[NOTIF-FG] sendTextEvent OK');
|
debugPrint('[NOTIF-FG] sendTextEvent OK');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[NOTIF-FG] sendTextEvent failed: $e — storing in prefs');
|
debugPrint('[NOTIF-FG] sendTextEvent failed: $e — storing in prefs');
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
await prefs.setString('notif_pending_reply_room', roomId);
|
await prefs.setString('notif_pending_reply_room', roomId);
|
||||||
await prefs.setString('notif_pending_reply_text', text);
|
await prefs.setString('notif_pending_reply_text', text);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print('[NOTIF-FG] room null — storing in prefs, waiting for sync');
|
debugPrint('[NOTIF-FG] room null — storing in prefs, waiting for sync');
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
await prefs.setString('notif_pending_reply_room', roomId);
|
await prefs.setString('notif_pending_reply_room', roomId);
|
||||||
await prefs.setString('notif_pending_reply_text', text);
|
await prefs.setString('notif_pending_reply_text', text);
|
||||||
try {
|
try {
|
||||||
await client.onSync.stream.first;
|
await client.onSync.stream.first;
|
||||||
print('[NOTIF-FG] sync arrived — retrying _sendPendingReply');
|
debugPrint('[NOTIF-FG] sync arrived — retrying _sendPendingReply');
|
||||||
await _sendPendingReply(ref);
|
await _sendPendingReply(ref);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[NOTIF-FG] sync/send error: $e');
|
debugPrint('[NOTIF-FG] sync/send error: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
print('[NOTIF-FG] reply skipped: text empty or roomId null');
|
debugPrint('[NOTIF-FG] reply skipped: text empty or roomId null');
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (details.actionId == 'read') {
|
if (details.actionId == 'read') {
|
||||||
final roomId = details.payload;
|
final roomId = details.payload;
|
||||||
if (roomId != null) _androidPlugin.cancel(_stableRoomId(roomId));
|
if (roomId != null) _androidPlugin.cancel(_stableRoomId(roomId));
|
||||||
print('[NOTIF-FG] read action — dismissed');
|
debugPrint('[NOTIF-FG] read action — dismissed');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final roomId = details.payload;
|
final roomId = details.payload;
|
||||||
print('[NOTIF-FG] tap → opening room $roomId');
|
debugPrint('[NOTIF-FG] tap → opening room $roomId');
|
||||||
if (roomId != null && roomId.isNotEmpty) {
|
if (roomId != null && roomId.isNotEmpty) {
|
||||||
ref.read(activeRoomIdProvider.notifier).state = roomId;
|
ref.read(activeRoomIdProvider.notifier).state = roomId;
|
||||||
ref.read(viewModeProvider.notifier).state = ViewMode.chat;
|
ref.read(viewModeProvider.notifier).state = ViewMode.chat;
|
||||||
@@ -145,7 +146,7 @@ Future<void> _initAndroid(WidgetRef ref) async {
|
|||||||
final args = call.arguments;
|
final args = call.arguments;
|
||||||
if (call.method == 'openRoom') {
|
if (call.method == 'openRoom') {
|
||||||
final roomId = (args is Map ? args['room_id'] : null) as String?;
|
final roomId = (args is Map ? args['room_id'] : null) as String?;
|
||||||
print('[NOTIF-FG] openRoom: $roomId');
|
debugPrint('[NOTIF-FG] openRoom: $roomId');
|
||||||
if (roomId != null && roomId.isNotEmpty) {
|
if (roomId != null && roomId.isNotEmpty) {
|
||||||
ref.read(activeRoomIdProvider.notifier).state = roomId;
|
ref.read(activeRoomIdProvider.notifier).state = roomId;
|
||||||
ref.read(viewModeProvider.notifier).state = ViewMode.chat;
|
ref.read(viewModeProvider.notifier).state = ViewMode.chat;
|
||||||
@@ -156,7 +157,7 @@ Future<void> _initAndroid(WidgetRef ref) async {
|
|||||||
// MethodChannel — no Activity was opened.
|
// MethodChannel — no Activity was opened.
|
||||||
final roomId = (args is Map ? args['room_id'] : null) as String?;
|
final roomId = (args is Map ? args['room_id'] : null) as String?;
|
||||||
final text = (args is Map ? args['text'] : null) as String?;
|
final text = (args is Map ? args['text'] : null) as String?;
|
||||||
print('[NOTIF-FG] replyFromNotification: room=$roomId text=$text');
|
debugPrint('[NOTIF-FG] replyFromNotification: room=$roomId text=$text');
|
||||||
if (roomId != null && roomId.isNotEmpty && text != null && text.isNotEmpty) {
|
if (roomId != null && roomId.isNotEmpty && text != null && text.isNotEmpty) {
|
||||||
_androidPlugin.cancel(_stableRoomId(roomId));
|
_androidPlugin.cancel(_stableRoomId(roomId));
|
||||||
Future<void> storePending() async {
|
Future<void> storePending() async {
|
||||||
@@ -170,9 +171,9 @@ Future<void> _initAndroid(WidgetRef ref) async {
|
|||||||
final room = client.getRoomById(roomId);
|
final room = client.getRoomById(roomId);
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
await room.sendTextEvent(text);
|
await room.sendTextEvent(text);
|
||||||
print('[NOTIF-FG] replyFromNotification: sent OK');
|
debugPrint('[NOTIF-FG] replyFromNotification: sent OK');
|
||||||
} else {
|
} else {
|
||||||
print('[NOTIF-FG] replyFromNotification: room null, storing in prefs');
|
debugPrint('[NOTIF-FG] replyFromNotification: room null, storing in prefs');
|
||||||
await storePending();
|
await storePending();
|
||||||
// Retry on the next sync — room list is populated after first sync.
|
// Retry on the next sync — room list is populated after first sync.
|
||||||
client.onSync.stream.first
|
client.onSync.stream.first
|
||||||
@@ -180,7 +181,7 @@ Future<void> _initAndroid(WidgetRef ref) async {
|
|||||||
.catchError((_) {});
|
.catchError((_) {});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[NOTIF-FG] replyFromNotification error: $e — storing in prefs');
|
debugPrint('[NOTIF-FG] replyFromNotification error: $e — storing in prefs');
|
||||||
await storePending();
|
await storePending();
|
||||||
// Resume-based retry (checkPendingReply in app.dart) will pick this up.
|
// Resume-based retry (checkPendingReply in app.dart) will pick this up.
|
||||||
}
|
}
|
||||||
@@ -225,7 +226,7 @@ Future<void> _initAndroid(WidgetRef ref) async {
|
|||||||
if (reply is Map) {
|
if (reply is Map) {
|
||||||
final roomId = reply['room_id'] as String?;
|
final roomId = reply['room_id'] as String?;
|
||||||
final text = reply['text'] as String?;
|
final text = reply['text'] as String?;
|
||||||
print('[NOTIF-REPLY] getInitialReply: roomId=$roomId text=$text');
|
debugPrint('[NOTIF-REPLY] getInitialReply: roomId=$roomId text=$text');
|
||||||
if (roomId != null && roomId.isNotEmpty && text != null && text.isNotEmpty) {
|
if (roomId != null && roomId.isNotEmpty && text != null && text.isNotEmpty) {
|
||||||
// Persist so _sendPendingReply sends it after the first sync.
|
// Persist so _sendPendingReply sends it after the first sync.
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
@@ -302,7 +303,7 @@ void _onIsolateMessage(dynamic message, WidgetRef ref) {
|
|||||||
final input = message['input'] as String?;
|
final input = message['input'] as String?;
|
||||||
final id = message['id'] as int?;
|
final id = message['id'] as int?;
|
||||||
|
|
||||||
print('[NOTIF-ISOLATE] action=$actionId payload=$payload input=$input');
|
debugPrint('[NOTIF-ISOLATE] action=$actionId payload=$payload input=$input');
|
||||||
|
|
||||||
switch (actionId) {
|
switch (actionId) {
|
||||||
case 'reply':
|
case 'reply':
|
||||||
@@ -315,9 +316,9 @@ void _onIsolateMessage(dynamic message, WidgetRef ref) {
|
|||||||
if (room != null) {
|
if (room != null) {
|
||||||
try {
|
try {
|
||||||
await room.sendTextEvent(text);
|
await room.sendTextEvent(text);
|
||||||
print('[NOTIF-ISOLATE] reply sent OK');
|
debugPrint('[NOTIF-ISOLATE] reply sent OK');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[NOTIF-ISOLATE] sendTextEvent failed: $e — storing in prefs');
|
debugPrint('[NOTIF-ISOLATE] sendTextEvent failed: $e — storing in prefs');
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
await prefs.setString('notif_pending_reply_room', roomId);
|
await prefs.setString('notif_pending_reply_room', roomId);
|
||||||
await prefs.setString('notif_pending_reply_text', text);
|
await prefs.setString('notif_pending_reply_text', text);
|
||||||
@@ -326,7 +327,7 @@ void _onIsolateMessage(dynamic message, WidgetRef ref) {
|
|||||||
.catchError((_) {});
|
.catchError((_) {});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print('[NOTIF-ISOLATE] room not in memory — storing in prefs');
|
debugPrint('[NOTIF-ISOLATE] room not in memory — storing in prefs');
|
||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
await prefs.setString('notif_pending_reply_room', roomId);
|
await prefs.setString('notif_pending_reply_room', roomId);
|
||||||
await prefs.setString('notif_pending_reply_text', text);
|
await prefs.setString('notif_pending_reply_text', text);
|
||||||
@@ -342,14 +343,14 @@ void _onIsolateMessage(dynamic message, WidgetRef ref) {
|
|||||||
} else if (id != null) {
|
} else if (id != null) {
|
||||||
_androidPlugin.cancel(id);
|
_androidPlugin.cancel(id);
|
||||||
}
|
}
|
||||||
print('[NOTIF-ISOLATE] read → notification dismissed');
|
debugPrint('[NOTIF-ISOLATE] read → notification dismissed');
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Plain notification tap → navigate to room.
|
// Plain notification tap → navigate to room.
|
||||||
if (payload != null && payload.isNotEmpty) {
|
if (payload != null && payload.isNotEmpty) {
|
||||||
ref.read(activeRoomIdProvider.notifier).state = payload;
|
ref.read(activeRoomIdProvider.notifier).state = payload;
|
||||||
ref.read(viewModeProvider.notifier).state = ViewMode.chat;
|
ref.read(viewModeProvider.notifier).state = ViewMode.chat;
|
||||||
print('[NOTIF-ISOLATE] tap → navigated to $payload');
|
debugPrint('[NOTIF-ISOLATE] tap → navigated to $payload');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -361,16 +362,16 @@ Future<void> _sendPendingReply(WidgetRef ref) async {
|
|||||||
final prefs = await SharedPreferences.getInstance();
|
final prefs = await SharedPreferences.getInstance();
|
||||||
final roomId = prefs.getString('notif_pending_reply_room');
|
final roomId = prefs.getString('notif_pending_reply_room');
|
||||||
final text = prefs.getString('notif_pending_reply_text');
|
final text = prefs.getString('notif_pending_reply_text');
|
||||||
print('[NOTIF-REPLY] _sendPendingReply: roomId=$roomId text=$text');
|
debugPrint('[NOTIF-REPLY] _sendPendingReply: roomId=$roomId text=$text');
|
||||||
if (roomId == null || text == null || text.isEmpty) return;
|
if (roomId == null || text == null || text.isEmpty) return;
|
||||||
|
|
||||||
final client = await ref.read(matrixClientProvider.future);
|
final client = await ref.read(matrixClientProvider.future);
|
||||||
print('[NOTIF-REPLY] client ready, rooms=${client.rooms.length}');
|
debugPrint('[NOTIF-REPLY] client ready, rooms=${client.rooms.length}');
|
||||||
|
|
||||||
final room = client.getRoomById(roomId);
|
final room = client.getRoomById(roomId);
|
||||||
print('[NOTIF-REPLY] getRoomById → ${room != null ? 'found' : 'null'}');
|
debugPrint('[NOTIF-REPLY] getRoomById → ${room != null ? 'found' : 'null'}');
|
||||||
if (room == null) {
|
if (room == null) {
|
||||||
print('[NOTIF-REPLY] room not in memory yet, retrying after next sync');
|
debugPrint('[NOTIF-REPLY] room not in memory yet, retrying after next sync');
|
||||||
client.onSync.stream.first
|
client.onSync.stream.first
|
||||||
.then((_) => _sendPendingReply(ref))
|
.then((_) => _sendPendingReply(ref))
|
||||||
.catchError((_) {});
|
.catchError((_) {});
|
||||||
@@ -378,11 +379,11 @@ Future<void> _sendPendingReply(WidgetRef ref) async {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await room.sendTextEvent(text);
|
await room.sendTextEvent(text);
|
||||||
print('[NOTIF-REPLY] sendTextEvent OK, clearing prefs');
|
debugPrint('[NOTIF-REPLY] sendTextEvent OK, clearing prefs');
|
||||||
await prefs.remove('notif_pending_reply_room');
|
await prefs.remove('notif_pending_reply_room');
|
||||||
await prefs.remove('notif_pending_reply_text');
|
await prefs.remove('notif_pending_reply_text');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[NOTIF-REPLY] error: $e — prefs kept for retry');
|
debugPrint('[NOTIF-REPLY] error: $e — prefs kept for retry');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -459,7 +460,7 @@ Future<void> _decryptAndUpdateNotification(
|
|||||||
.timeout(const Duration(seconds: 5));
|
.timeout(const Duration(seconds: 5));
|
||||||
var room = client.getRoomById(roomId);
|
var room = client.getRoomById(roomId);
|
||||||
if (room == null) {
|
if (room == null) {
|
||||||
print('[NOTIF] decryptAndUpdate: room $roomId not found');
|
debugPrint('[NOTIF] decryptAndUpdate: room $roomId not found');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -469,7 +470,7 @@ Future<void> _decryptAndUpdateNotification(
|
|||||||
final bool alreadyHave =
|
final bool alreadyHave =
|
||||||
eventId == null || event?.eventId == eventId;
|
eventId == null || event?.eventId == eventId;
|
||||||
if (!alreadyHave || event == null) {
|
if (!alreadyHave || event == null) {
|
||||||
print('[NOTIF] decryptAndUpdate: waiting for sync to deliver $eventId');
|
debugPrint('[NOTIF] decryptAndUpdate: waiting for sync to deliver $eventId');
|
||||||
await client.onSync.stream.first.timeout(const Duration(seconds: 12));
|
await client.onSync.stream.first.timeout(const Duration(seconds: 12));
|
||||||
room = client.getRoomById(roomId);
|
room = client.getRoomById(roomId);
|
||||||
if (room == null) return;
|
if (room == null) return;
|
||||||
@@ -477,7 +478,7 @@ Future<void> _decryptAndUpdateNotification(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (event == null) {
|
if (event == null) {
|
||||||
print('[NOTIF] decryptAndUpdate: event still null after sync');
|
debugPrint('[NOTIF] decryptAndUpdate: event still null after sync');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (event.type != EventTypes.Message) return;
|
if (event.type != EventTypes.Message) return;
|
||||||
@@ -486,7 +487,7 @@ Future<void> _decryptAndUpdateNotification(
|
|||||||
final rawBody = event.body;
|
final rawBody = event.body;
|
||||||
// If decryption failed the body starts with "** Unable to decrypt"
|
// If decryption failed the body starts with "** Unable to decrypt"
|
||||||
if (rawBody.isEmpty || rawBody.startsWith('**')) {
|
if (rawBody.isEmpty || rawBody.startsWith('**')) {
|
||||||
print('[NOTIF] decryptAndUpdate: decryption failed, keeping placeholder');
|
debugPrint('[NOTIF] decryptAndUpdate: decryption failed, keeping placeholder');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -507,9 +508,9 @@ Future<void> _decryptAndUpdateNotification(
|
|||||||
'roomId': roomId,
|
'roomId': roomId,
|
||||||
'notifId': notifId ?? _stableRoomId(roomId),
|
'notifId': notifId ?? _stableRoomId(roomId),
|
||||||
});
|
});
|
||||||
print('[NOTIF] decryptAndUpdate: updated notification → "$title: $notifBody"');
|
debugPrint('[NOTIF] decryptAndUpdate: updated notification → "$title: $notifBody"');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[NOTIF] decryptAndUpdate error: $e');
|
debugPrint('[NOTIF] decryptAndUpdate error: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -533,7 +534,7 @@ Future<void> showMessageNotification({
|
|||||||
'notifId': _stableRoomId(roomId),
|
'notifId': _stableRoomId(roomId),
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[NOTIF] showNativeNotification failed: $e');
|
debugPrint('[NOTIF] showNativeNotification failed: $e');
|
||||||
}
|
}
|
||||||
} else if (Platform.isWindows) {
|
} else if (Platform.isWindows) {
|
||||||
// Close the previous notification for this room before showing a new one.
|
// Close the previous notification for this room before showing a new one.
|
||||||
|
|||||||
+11
-12
@@ -1,7 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
|
import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
@@ -54,7 +53,7 @@ class PyramidVoipManager extends ChangeNotifier implements WebRTCDelegate {
|
|||||||
await remoteRenderer.initialize();
|
await remoteRenderer.initialize();
|
||||||
_renderersInitialized = true;
|
_renderersInitialized = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[VOIP] Renderer init error: $e');
|
debugPrint('[VOIP] Renderer init error: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,14 +79,14 @@ class PyramidVoipManager extends ChangeNotifier implements WebRTCDelegate {
|
|||||||
merged['iceServers'] = [...existing, ...extra];
|
merged['iceServers'] = [...existing, ...extra];
|
||||||
configuration = merged;
|
configuration = merged;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[VOIP] ICE server merge error: $e');
|
debugPrint('[VOIP] ICE server merge error: $e');
|
||||||
}
|
}
|
||||||
return rtc.createPeerConnection(configuration, constraints);
|
return rtc.createPeerConnection(configuration, constraints);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> handleNewCall(CallSession call) async {
|
Future<void> handleNewCall(CallSession call) async {
|
||||||
print('[VOIP] Incoming call ${call.callId} (type: ${call.type})');
|
debugPrint('[VOIP] Incoming call ${call.callId} (type: ${call.type})');
|
||||||
await _ensureRenderers();
|
await _ensureRenderers();
|
||||||
currentCall = call;
|
currentCall = call;
|
||||||
_isCameraMuted = call.type == CallType.kVoice;
|
_isCameraMuted = call.type == CallType.kVoice;
|
||||||
@@ -99,12 +98,12 @@ class PyramidVoipManager extends ChangeNotifier implements WebRTCDelegate {
|
|||||||
Timer? _renderRefreshTimer;
|
Timer? _renderRefreshTimer;
|
||||||
void _setupCallListeners(CallSession call) {
|
void _setupCallListeners(CallSession call) {
|
||||||
call.onCallStateChanged.stream.listen((state) {
|
call.onCallStateChanged.stream.listen((state) {
|
||||||
print('[VOIP] State: $state');
|
debugPrint('[VOIP] State: $state');
|
||||||
_updateInternalStates();
|
_updateInternalStates();
|
||||||
|
|
||||||
if (state == CallState.kConnected) {
|
if (state == CallState.kConnected) {
|
||||||
if (!_isCameraMuted) {
|
if (!_isCameraMuted) {
|
||||||
print('[VOIP] Ensuring camera is unmuted on connect');
|
debugPrint('[VOIP] Ensuring camera is unmuted on connect');
|
||||||
call.setLocalVideoMuted(false);
|
call.setLocalVideoMuted(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,7 +203,7 @@ class PyramidVoipManager extends ChangeNotifier implements WebRTCDelegate {
|
|||||||
bool changed = false;
|
bool changed = false;
|
||||||
if (remote != null && remote.getVideoTracks().isNotEmpty) {
|
if (remote != null && remote.getVideoTracks().isNotEmpty) {
|
||||||
if (remoteRenderer.srcObject?.id != remote.id) {
|
if (remoteRenderer.srcObject?.id != remote.id) {
|
||||||
print('[VOIP] Assigning Remote Renderer: ${remote.id} (${remote.getVideoTracks().length} video tracks)');
|
debugPrint('[VOIP] Assigning Remote Renderer: ${remote.id} (${remote.getVideoTracks().length} video tracks)');
|
||||||
remoteRenderer.srcObject = remote;
|
remoteRenderer.srcObject = remote;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
@@ -215,7 +214,7 @@ class PyramidVoipManager extends ChangeNotifier implements WebRTCDelegate {
|
|||||||
|
|
||||||
if (local != null && local.getVideoTracks().isNotEmpty) {
|
if (local != null && local.getVideoTracks().isNotEmpty) {
|
||||||
if (localRenderer.srcObject?.id != local.id) {
|
if (localRenderer.srcObject?.id != local.id) {
|
||||||
print('[VOIP] Assigning Local Renderer: ${local.id} (${local.getVideoTracks().length} video tracks)');
|
debugPrint('[VOIP] Assigning Local Renderer: ${local.id} (${local.getVideoTracks().length} video tracks)');
|
||||||
localRenderer.srcObject = local;
|
localRenderer.srcObject = local;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
@@ -226,7 +225,7 @@ class PyramidVoipManager extends ChangeNotifier implements WebRTCDelegate {
|
|||||||
|
|
||||||
if (changed) notifyListeners();
|
if (changed) notifyListeners();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[VOIP] Error in _updateRenderers: $e');
|
debugPrint('[VOIP] Error in _updateRenderers: $e');
|
||||||
} finally {
|
} finally {
|
||||||
_isUpdating = false;
|
_isUpdating = false;
|
||||||
}
|
}
|
||||||
@@ -301,7 +300,7 @@ class PyramidVoipManager extends ChangeNotifier implements WebRTCDelegate {
|
|||||||
await action();
|
await action();
|
||||||
await Future.delayed(const Duration(milliseconds: 1000));
|
await Future.delayed(const Duration(milliseconds: 1000));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[VOIP] Action error: $e');
|
debugPrint('[VOIP] Action error: $e');
|
||||||
}
|
}
|
||||||
_updateInternalStates();
|
_updateInternalStates();
|
||||||
_updateRenderers();
|
_updateRenderers();
|
||||||
@@ -330,7 +329,7 @@ class PyramidVoipManager extends ChangeNotifier implements WebRTCDelegate {
|
|||||||
await _updateRenderers();
|
await _updateRenderers();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[VOIP] toggleCamera error: $e');
|
debugPrint('[VOIP] toggleCamera error: $e');
|
||||||
_isCameraMuted = !_isCameraMuted;
|
_isCameraMuted = !_isCameraMuted;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
@@ -379,7 +378,7 @@ class PyramidVoipManager extends ChangeNotifier implements WebRTCDelegate {
|
|||||||
await _ensureRenderers();
|
await _ensureRenderers();
|
||||||
_isCameraMuted = !video;
|
_isCameraMuted = !video;
|
||||||
|
|
||||||
print('[VOIP] Starting call in room $roomId (video=$video)');
|
debugPrint('[VOIP] Starting call in room $roomId (video=$video)');
|
||||||
final call = await voip.inviteToCall(room, video ? CallType.kVideo : CallType.kVoice);
|
final call = await voip.inviteToCall(room, video ? CallType.kVideo : CallType.kVoice);
|
||||||
currentCall = call;
|
currentCall = call;
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class _ScreenSharePickerState extends State<ScreenSharePicker> with SingleTicker
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('[Picker] Error loading sources: $e');
|
debugPrint('[Picker] Error loading sources: $e');
|
||||||
if (mounted) setState(() => _loading = false);
|
if (mounted) setState(() => _loading = false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user