Fix message display and add voice note debugging

- Fix escaped backslashes in timestamp and sender name display
- Add comprehensive logging for voice note transmission pipeline
- Add peripheral write completion logging
- Track broadcast success/failure for central updates
- Log audio recorder creation and preparation steps
- Better diagnostics for troubleshooting voice note issues
This commit is contained in:
jack
2025-07-03 23:28:07 +02:00
parent 78ddb36db7
commit 8346ecd2a7
4 changed files with 23 additions and 6 deletions
+4
View File
@@ -631,6 +631,8 @@ extension ChatViewModel: BitchatDelegate {
}
func sendVoiceNote(_ audioData: Data, duration: TimeInterval) {
print("[VIEWMODEL] sendVoiceNote called with audio data: \(audioData.count) bytes, duration: \(duration)s")
let message = BitchatMessage(
sender: nickname,
content: "🎤 \(String(format: "%.1f", duration))s",
@@ -642,6 +644,8 @@ extension ChatViewModel: BitchatDelegate {
)
messages.append(message)
print("[VIEWMODEL] Added voice note to local messages, sending via mesh...")
// Send via mesh
meshService.sendVoiceNote(audioData, duration: duration)
}