mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 18:05:19 +00:00
Cleanup: remove dead code, normalize fingerprints, modernize share extension, trim test noise, and drop ‘preparing to share…’ message (#520)
* Remove dead code and artifacts: drop PeerManager, unused views/types; delete LegacyTestProtocolTypes; update .gitignore; purge TestResult.xcresult and build.log * Tests: gate verbose prints under DEBUG; ChatViewModel: remove legacy fingerprint helper and rely on UnifiedPeerService * Share Extension: migrate to UIKit + UTTypes; drop Social/SLComposeServiceViewController * Remove 'preparing to share …' system message; send shared content immediately * Inline comment cleanup: drop legacy 'removed' breadcrumbs across protocols, services, view model, and views --------- Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
@@ -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,26 +3617,8 @@ class ChatViewModel: ObservableObject, BitchatDelegate {
|
||||
return unifiedPeerService.getFingerprint(for: peerID)
|
||||
}
|
||||
|
||||
private func getFingerprint_old(for peerID: String) -> String? {
|
||||
// Remove debug logging to prevent console spam during view updates
|
||||
|
||||
// First try to get fingerprint from mesh service's peer ID rotation mapping
|
||||
if let fingerprint = meshService.getFingerprint(for: peerID) {
|
||||
return fingerprint
|
||||
}
|
||||
|
||||
// Check noise service (direct Noise session fingerprint)
|
||||
if let fingerprint = meshService.getNoiseService().getPeerFingerprint(peerID) {
|
||||
return fingerprint
|
||||
}
|
||||
|
||||
// Last resort: check local mapping
|
||||
if let fingerprint = peerIDToPublicKeyFingerprint[peerID] {
|
||||
return fingerprint
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
// Helper to resolve nickname for a peer ID through various sources
|
||||
@MainActor
|
||||
@@ -4034,7 +4016,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate {
|
||||
messageRouter.flushOutbox(for: peerID)
|
||||
}
|
||||
|
||||
// Connection messages removed to reduce chat noise
|
||||
//
|
||||
}
|
||||
|
||||
func didDisconnectFromPeer(_ peerID: String) {
|
||||
@@ -4101,7 +4083,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
// Disconnection messages removed to reduce chat noise
|
||||
//
|
||||
}
|
||||
|
||||
func didUpdatePeerList(_ peers: [String]) {
|
||||
@@ -4414,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() {
|
||||
@@ -4745,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) {
|
||||
|
||||
Reference in New Issue
Block a user