mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-27 00:45:23 +00:00
The 1,109-line coordinator becomes a 187-line facade wiring three components, each with its own narrow context protocol: GeohashSubscriptionManager (384 lines - subscription IDs + relay lifecycle, the only NostrRelayManager toucher), NostrInboundPipeline (490 lines - the hot event path, dedup-before-verify ordering preserved verbatim), and GeoPresenceTracker (192 lines - teleport detection, sampling LRU, notification cooldowns, now directly tested). Perf baselines confirm the hot path is unchanged: fresh events 2,131 -> 2,138/sec, duplicates ~1.41M/sec. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ChatViewModel Extensions
This directory contains extensions to ChatViewModel to modularize its functionality.
ChatViewModel+Tor.swift: Handles Tor lifecycle events and notifications.ChatViewModel+PrivateChat.swift: Manages private chat logic, media transfers (images, voice notes), and file handling.ChatViewModel+Nostr.swift: Contains all logic related to Nostr integration, Geohash channels, and Nostr identity management.
The main ChatViewModel.swift retains core state, initialization, and coordination logic.