From 334c6271b618ca36f4b78d552f559814eb3cbca5 Mon Sep 17 00:00:00 2001 From: jack Date: Mon, 25 Aug 2025 17:57:21 +0200 Subject: [PATCH] Inline comment cleanup: drop legacy 'removed' breadcrumbs across protocols, services, view model, and views --- bitchat/Identity/IdentityModels.swift | 4 ++-- bitchat/Models/BitchatPeer.swift | 2 +- bitchat/Nostr/NostrProtocol.swift | 2 +- bitchat/Protocols/BitchatProtocol.swift | 8 +++----- bitchat/Services/BLEService.swift | 2 +- bitchat/Services/CommandProcessor.swift | 2 +- bitchat/ViewModels/ChatViewModel.swift | 16 ++++++++-------- bitchat/Views/ContentView.swift | 6 +++--- 8 files changed, 20 insertions(+), 22 deletions(-) diff --git a/bitchat/Identity/IdentityModels.swift b/bitchat/Identity/IdentityModels.swift index 2054c787..00eff84e 100644 --- a/bitchat/Identity/IdentityModels.swift +++ b/bitchat/Identity/IdentityModels.swift @@ -173,7 +173,7 @@ struct PendingActions { var setPetname: String? } -// (PrivacySettings, ConflictResolution, PeerUIState, ConnectionQuality removed; unused.) +// // MARK: - Migration Support -// Removed LegacyFavorite - no longer needed +// diff --git a/bitchat/Models/BitchatPeer.swift b/bitchat/Models/BitchatPeer.swift index d1fb4375..e33ce464 100644 --- a/bitchat/Models/BitchatPeer.swift +++ b/bitchat/Models/BitchatPeer.swift @@ -89,4 +89,4 @@ struct BitchatPeer: Identifiable, Equatable { } } -// (Legacy PeerManager removed; superseded by UnifiedPeerService.) +// diff --git a/bitchat/Nostr/NostrProtocol.swift b/bitchat/Nostr/NostrProtocol.swift index 5284dd70..46673e21 100644 --- a/bitchat/Nostr/NostrProtocol.swift +++ b/bitchat/Nostr/NostrProtocol.swift @@ -416,7 +416,7 @@ struct NostrProtocol { // Log with explicit UTC and local time for debugging let formatter = DateFormatter() - // Removed unnecessary date formatting operations + // formatter.dateFormat = "yyyy-MM-dd HH:mm:ss" formatter.timeZone = TimeZone(abbreviation: "UTC") diff --git a/bitchat/Protocols/BitchatProtocol.swift b/bitchat/Protocols/BitchatProtocol.swift index 9b3838ac..758b0a61 100644 --- a/bitchat/Protocols/BitchatProtocol.swift +++ b/bitchat/Protocols/BitchatProtocol.swift @@ -181,8 +181,7 @@ enum LazyHandshakeState { case failed(Error) // Handshake failed } -// MARK: - Special Recipients (removed) -// Previously defined broadcast identifiers were unused; removed for simplicity. +// // MARK: - Core Protocol Structures @@ -268,8 +267,7 @@ struct BitchatPacket: Codable { } } -// MARK: - Delivery Acknowledgments (removed) -// Legacy DeliveryAck structures are no longer used; delivery status flows via Noise payloads. +// // MARK: - Read Receipts @@ -361,7 +359,7 @@ struct ReadReceipt: Codable { } -// PeerIdentityBinding removed (unused). +// // MARK: - Delivery Status diff --git a/bitchat/Services/BLEService.swift b/bitchat/Services/BLEService.swift index 5f58cc55..0110bf08 100644 --- a/bitchat/Services/BLEService.swift +++ b/bitchat/Services/BLEService.swift @@ -730,7 +730,7 @@ final class BLEService: NSObject { } } - // Removed unused getPeers(): use getPeerNicknames() from Transport + // // MARK: - Private Message Handling diff --git a/bitchat/Services/CommandProcessor.swift b/bitchat/Services/CommandProcessor.swift index 662a4fd4..7a7abcce 100644 --- a/bitchat/Services/CommandProcessor.swift +++ b/bitchat/Services/CommandProcessor.swift @@ -63,7 +63,7 @@ class CommandProcessor { case "/unfav": if inGeoPublic || inGeoDM { return .error(message: "favorites are only for mesh peers in #mesh") } return handleFavorite(args, add: false) - // /help removed + // case "/help", "/h": return .error(message: "unknown command: \(cmd)") default: diff --git a/bitchat/ViewModels/ChatViewModel.swift b/bitchat/ViewModels/ChatViewModel.swift index ee972217..20dee000 100644 --- a/bitchat/ViewModels/ChatViewModel.swift +++ b/bitchat/ViewModels/ChatViewModel.swift @@ -297,7 +297,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate { } } - // Missing properties that were removed during refactoring + // private var peerIDToPublicKeyFingerprint: [String: String] = [:] private var selectedPrivateChatFingerprint: String? = nil // Map stable short peer IDs (16-hex) to full Noise public key hex (64-hex) for session continuity @@ -1561,7 +1561,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate { } catch { // ignore } - // Presence announcement removed; we will tag actual chat events instead + // } // MARK: - Geohash Participants @@ -1714,7 +1714,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate { let toAdd = desired.subtracting(current) let toRemove = current.subtracting(desired) - // Unsubscribe removed + // for (subID, gh) in geoSamplingSubs where toRemove.contains(gh) { NostrRelayManager.shared.unsubscribe(id: subID) geoSamplingSubs.removeValue(forKey: subID) @@ -3617,7 +3617,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate { return unifiedPeerService.getFingerprint(for: peerID) } - // (legacy getFingerprint_old removed; UnifiedPeerService is the source of truth) + // // Helper to resolve nickname for a peer ID through various sources @@ -4016,7 +4016,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate { messageRouter.flushOutbox(for: peerID) } - // Connection messages removed to reduce chat noise + // } func didDisconnectFromPeer(_ peerID: String) { @@ -4083,7 +4083,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate { } } - // Disconnection messages removed to reduce chat noise + // } func didUpdatePeerList(_ peers: [String]) { @@ -4396,7 +4396,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate { // MARK: - Simplified Nostr Integration (Inlined from MessageRouter) - // Removed inlined Nostr send helpers in favor of MessageRouter + // @MainActor private func setupNostrMessageHandling() { @@ -4727,7 +4727,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate { return Data(base64Encoded: str) } - // Removed local TLV decoder; using PrivateMessagePacket.decode from Protocols + // @MainActor private func handleFavoriteNotificationFromMesh(_ content: String, from peerID: String, senderNickname: String) { diff --git a/bitchat/Views/ContentView.swift b/bitchat/Views/ContentView.swift index 165601e6..e630be50 100644 --- a/bitchat/Views/ContentView.swift +++ b/bitchat/Views/ContentView.swift @@ -13,9 +13,9 @@ import UIKit // MARK: - Supporting Types -// (PeerDisplayData removed; unused.) +// -// (Link previews removed; URLs are now clickable inline) +// // MARK: - Main Content View @@ -1372,7 +1372,7 @@ private struct PaymentChipView: View { } } -// (MessageContentView removed; unused.) +// // Delivery status indicator view struct DeliveryStatusView: View {