* Extract `processNostrMessage` into a function
* `updateChannelActivityTimeThenSend` function
* Break down / flatten `beginGeohashSampling`
* Extract `subscribeNostrEvent` into a function
* Break down / flatten `resubscribeCurrentGeohash`
- Add NetworkActivationService to permit Tor/Nostr only when location is authorized OR at least one mutual favorite exists.
- Gate TorManager.startIfNeeded/ensureRunningOnForeground behind a global allowAutoStart flag.
- Always stop Tor on background for deterministic restarts; rebuild sessions on foreground when allowed.
- NostrRelayManager respects the gate in connect/ensureConnections/subscribe/send/connectToRelay and skips reconnection when disallowed.
- Symmetric shutdown when conditions become disallowed: disconnect relays and stop Tor.
- Fix double-start by avoiding restart if Tor is already ready; prevent background thrash.
- Improve UX: post "starting tor…" via TorWillStart, and "tor started…" on initial ready; keep existing restart messages.
Rationale: Avoid starting Tor/relays when the user has no location permission and no mutual favorites, and ensure a clean, predictable lifecycle (no stale sockets, no double starts).
Co-authored-by: jack <jackjackbits@users.noreply.github.com>
* Extract BitchatMessage into a separate file
* Convert `fromBinaryPayload` to `convenience init?`
* Extract message dedup into an extension
* Remove dead `formatMessageContent`
* Minor refactor of timestamp and username formatting
* Remove dead `getSenderColor`
* Extract MessagePadding into a separate file
* Extract BitchatPacket into a separate file
* Extract ReadReceipt into a separate file
* Extract NoisePayload into a separate file
* Remove unnecessary import
* Extract peer-seed color calculation out
* Extract `handleDeliveredReadReceipt` to a new function
* Extract `handlePrivateMessage` to a new function
* Separate `delivered` and `readReceipt` functions
* Extract `handleGiftWrap` into a function
* Extract `subscribeToGeoChat` into a function
* Minor cleanup
* Extract `handleNostrEvent` into a function
* Minor cleanup
* Create `sendGeohash` function + minor cleanup
* Extract sending geohash dm into a function
* Check for blocks before trying to send a DM
* Extract BitchatMessage into a separate file
* Convert `fromBinaryPayload` to `convenience init?`
* Extract message dedup into an extension
* Remove dead `formatMessageContent`
* Minor refactor of timestamp and username formatting
* Remove dead `getSenderColor`
* Extract MessagePadding into a separate file
* Extract BitchatPacket into a separate file
* Extract ReadReceipt into a separate file
* Extract NoisePayload into a separate file
* Remove unnecessary import
* Extract BitchatMessage into a separate file
* Convert `fromBinaryPayload` to `convenience init?`
* Extract message dedup into an extension
* Remove dead `formatMessageContent`
* Minor refactor of timestamp and username formatting
* Remove dead `getSenderColor`
* Create configs files with basic settings populated
* Add Configs and set the global Debug/Release settings
* Update build settings to be read from the configs
* Remove `xcodegen`’s `project.yml`
* Configurable and dynamic bundle and group ids
* Simplified local development with custom Team IDs
* wip
* woohooo
* Plumtree gossip: don't subset REQUEST_SYNC fanout; make RequestSyncPacket.encode use const
* bloom -> gcs [wip]
* fix build
* fix broadcast
* prune old messages too
* faster sync
* prune better
* adjust parameters
* fix(sync): make cap a constant in GCSFilter.buildFilter to silence 'never mutated' warning
* fix(mesh): surface self-origin public messages recovered via sync; only ignore self when TTL != 0 in handleMessage
* sync: allow self messages via GCS restore and relax TTL==0 acceptance\n- Bypass dedup for self TTL==0 packets in handleReceivedPacket\n- Accept self TTL==0 in handleMessage and set nickname\n- Accept unknown senders for TTL==0 with anon# prefix to restore history
---------
Co-authored-by: jack <jackjackbits@users.noreply.github.com>
* Remove unused LocationNotesSheet.swift
* Add README.md to bitchatTest group to mirror the folder
* Convert bitchat, Tests, ShareExtension to folders
* Update Project Format to Xcode 16.3 (latest)
* UI: replace textual 'close' with X icon\n\n- AppInfoView (iOS): use xmark icon in nav bar to match Location Notes style.\n- LocationChannelsSheet: use xmark icon for close on iOS/macOS toolbars; add accessibility label.
* Location Notes: prefix usernames with @ and lighten #geohash\n\n- Show @ before usernames in notes list.\n- Split header into '@' and '#geohash' and color the geohash with secondary green for consistency.
* Header spacing: add breathing room between channel badge, notes button, and people count\n\n- Add trailing padding after #mesh/#geohash badge.\n- Add leading padding before notes button and people counter to improve readability.
* Header: nudge #mesh/#geohash badge right with leading padding
* Location Notes + Header polish\n\n- Header: add space in '@ #geohash' and use darker green for geohash.\n- Notes list: render '@name#abcd' with darker green for #abcd to match chat.\n- Header: move geochat bookmark icon after #geohash badge with consistent spacing.
* Location Notes: @name regular green, #abcd darker; nudge #hash\n\n- Render '@' and base name in regular green, suffix '#abcd' in darker green.\n- Add extra left padding before '#geohash' in notes header.\n- Increase leading padding for channel badge to push #mesh/#geohash further right.
* Fix notes icon color: subscribe/count at block-level geohash\n\n- Use block (precision 7) geohash for notes: when opening sheet, on channel changes, and when subscribing the counter.\n- Aligns with LocationNotesManager which publishes at street-level geohash, allowing the counter to detect notes and turn icon blue.
* Header spacing: move #mesh/#geohash closer to notes/bookmark\n\n- Reduce trailing padding on channel badge and leading padding on notes/bookmark to cluster them together.\n- Keeps larger gap before people count for readability.
* Notes: standardize on building-level (8 chars) for publish/read\n\n- Use .building geohash when opening notes, reacting to channel updates, and subscribing the counter.\n- Update comments to reflect building-level scope.
* Location Channels sheet: use black sheet background like other sheets\n\n- Add backgroundColor and apply to container and list.\n- Hide list default background with scrollContentBackground(.hidden).
* Notes icon: use green when notes exist (matches app green)
* Location Channels: boxed 'bookmarked' section; keep 'remove location access' outside box\n\n- Wrap bookmarked list in a rounded, subtle grey box within the list.\n- Ensure the 'remove location access' button is not inside the box and clears list row background.
* Notes counter UX: avoid grey flicker when closing sheet\n\n- Preserve last count during resubscribe to prevent brief 0 state.\n- Keep existing subscription when building geohash temporarily unavailable; only cancel if none or permission revoked.
* Notes counter: unsubscribe without clearing count on resubscribe\n\n- Avoid calling cancel() in subscribe; just unsubscribe old sub to prevent wiping count to 0.\n- Prevents green→grey flicker after closing sheet or location updates.
* Notes icon: use sheet count until counter finishes initial load; don’t zero on sheet close\n\n- Compute hasNotes using max(count, sheetCount) while initialLoadComplete is false.\n- Remove sheetNotesCount reset on sheet disappear to avoid transient grey.
* Location Notes header: remove extra gap before #geohash (drop leading padding)
* Notes sheet: color #abcd suffix as darker green via opacity (match chat)
* Notes sheet: show timestamp in brackets; drop #abcd from @name
* chore: commit remaining local changes
* Header: move notes + bookmark to left of #mesh/#geohash
* Header spacing: tighten gap between #mesh/#geohash and peer count
---------
Co-authored-by: jack <jackjackbits@users.noreply.github.com>
* SPM Test target + Github Action to build and test
Because the tests are XCTests `swift test` runs them first and then runs another batch of empty tests which results in "0 tests" at the end of the report - https://github.com/swiftlang/swift-package-manager/issues/8529#issuecomment-2815711345
* Fix dependency and library issues + handle mixed languages
`include` folder has to be next to the `*.c` file for it to work
* Location notes: Matrix loader with 1–3s minimum display; allow multiple notes; wire notes UI from mesh toolbar
* Location notes: prevent duplicate loading/subscriptions (StateObject manager, geohash captured at open, guard subscribe)
* Location notes: fix duplicate state redeclaration in ContentView
* Location notes: render note bodies with monospaced font in notes list
* Location notes: add close (x) button in sheet header (upper-right) using @Environment(\.dismiss)
* Location notes: acquire geohash on open (force refresh) and show Matrix loader until block-level geohash resolves; add LocationNotesSheet wrapper
* Location notes: inline sheet wrapper to avoid missing file in target; force location refresh and show Matrix loader until block geohash resolves
* Location notes: remove Matrix animation; use simple spinner when acquiring location; simplify notes view layout
* Location notes: remove per-note relative timestamp from sheet (no seconds display)
* Location notes: fix intermittent first load by ensuring resubscribe after geohash change, removing over-eager subscribe guard, and widening note fetch window (no since filter)
* Location notes: add background counter service and show count next to notes icon on mesh; auto-subscribe to current block geohash
* Location notes: move notes icon to the right of #mesh badge in toolbar
* Location notes: restore timestamps in notes list; remove loading state from manager and sheet (no spinner/animation)
* Location notes: drop 'teleport' tag from kind-1 events; simplify note builder API and usage
* Location notes: show timestamp as relative within 7 days, else absolute date (MMM d or MMM d, y); keep monospaced styling
* Location notes: append 'ago' to relative timestamps (within 7 days)
* Switch location notes and UI helpers to building-level geohash (precision 8): add GeohashChannelLevel.building, map length 8, use building for notes selection and counter, add building name mapping
* Location notes: change notes toolbar icon to SF Symbol 'long.text.page.and.pencil'
* Revert notes geohash selection back to block-level (precision 7); keep building level available but unused; update counter and sheet accordingly
* Location notes: show block name (from reverse geocode) in header instead of 'street-level notes'
* Nostr: add EOSE handling with callback support for subscriptions; wire to LocationNotesManager/Counter (initialLoadComplete). Remove 'building' level from channel enum and geocoder mapping; geohash list shows block/neighborhood/city/province/region only
* Fix Swift 6 isolation: hop to @MainActor inside Timer callback for EOSE tracker mutations
* Notes counter: show 0 by default; subscribe at building-level (precision 8) for notes and counter; keep building hidden in channel list
* Notes header: show building name when available (fallback to block name)
* Notes: subscribe counter to building + parent block (merge results); hide notes icon unless location is authorized; replace 10s timer with live location updates while sheet open
* Notes counter: subscribe only to building geohash (precision 8) so count reflects current 8-cell; auto-begin live location refresh on mesh (and permission) to update as you walk
* Notes header: show count in parentheses; icon shows blue if any notes, grey if none; only start live location updates while sheet is open; reduce nickname width; set live distance filter to 10m
* Notes header: show count as '(N note/notes)' with non-bold, secondary styling next to title
* Notes header: move count before title as '<N> note(s) @ #gh'; remove parentheses; keep count non-bold
* Notes header: bold count text; ensure sheet updates when building geohash changes by calling manager.setGeohash on geohash change
* Notes sheet: add light haptic feedback when building geohash changes (iOS only)
* Notes icon: force a one-shot location refresh before (re)subscribing the counter so icon turns blue immediately on current 8-cell
* Notes subscribe: fallback to default relays when GeoRelayDirectory has no entries (pass nil relayUrls) so counter/icon turn blue and sheet loads even before georelay fetch
* Notes icon: turn blue immediately when sheet shows notes by passing count up from sheet (closure) and OR-ing with counter; reset on sheet close
---------
Co-authored-by: jack <jackjackbits@users.noreply.github.com>
* Favorites: mesh-only system message; stop reconnect resends; gate system on state change
* Favorites: remove npub resend tracking and nickname-based key migration; rely on Noise key as identity
---------
Co-authored-by: jack <jackjackbits@users.noreply.github.com>
* Fix emote targeting and grammar; add tests
Prevent 'system' mis-target via peerID-derived display name in actions sheet. Correct /hug and /slap usage/error grammar by passing base command name. Improve geohash nickname resolution to match displayName with #suffix. Add CommandProcessor tests.
* Geohash ordering: strict in-order inserts and timestamp clamp
Use channel-aware late-insert threshold with 0s for geohash to keep strict chronological order. Clamp future Nostr event timestamps to 'now' to avoid future-dated items skewing order in geohash timelines.
* Trim trailing/leading spaces in geohash nicknames and tag emission
Sanitize Nostr 'n' tag values on ingest and emit by trimming whitespace/newlines to prevent trailing spaces in displayed usernames. Local nickname is already trimmed on focus loss and submit.
---------
Co-authored-by: jack <jackjackbits@users.noreply.github.com>