Repository navigation
Chat: direct messages and channel messages - #7
Merged
Merged
Conversation
When the radio's GPS is stuck, MeshAnd can send the phone's location to its own radio (POSITION_APP to our own node number, LOC_EXTERNAL). The radio uses it as its own position and broadcasts it on its usual schedule, so it adds no airtime. - PhoneGpsFeeder: LocationManager GPS fixes every 30 s; skips fixes worse than 100 m, older than 60 s, or within 15 s of the last send - Opt-in switch in Settings and a "Use phone GPS" button on the GPS card when the radio's fix isn't good; location permission asked on enable - Foreground service adds the location type while it's on; falls back to "open MeshAnd to resume" when Android 14+ refuses it in background - AGENTS.md and CHANGELOG updated Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Chat tab lists every channel on the radio plus one conversation per direct-message partner, with unread badges. A conversation shows the messages (sender, time, delivery state) and a compose box limited to the 233-byte payload. "Message" on node cards and team member cards opens a direct conversation. ChatRepository collects TEXT_MESSAGE_APP packets (pins stay in Pins), saves them to chat.tsv, notifies per conversation, and sends with RadioClient.sendText, tracking MessageHandle.state. Channel names come from RadioClient.channels; keys and settings are never read or logged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
9 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds chat to MeshAnd: read and send text messages, both to channels (the primary plus any secondary channels on the radio) and directly to one node.
Stacked on #6 (phone GPS). This branch starts from
feature/phone-gps-override, so until #6 is merged this PR also shows that commit. Merge #6 first; the chat change itself is the last commit (5ce7e4c).What's new
How it works
ChatRepositorycollectsclient.session→packets, likePinRepository. It keepsTEXT_MESSAGE_APPpackets that aren'tmeshand:pins (PinText.parseMessage). Broadcast → channelpacket.channel; to or from our node → direct conversation with the other side. Repeats are dropped by sender + packet id.RadioClient.sendText(text, to, channel). Channels go toNodeId.BROADCAST. A direct message goes on the channel the partner last wrote to us on (else 0); radios with each other's keys encrypt DMs end-to-end anyway. Delivery comes fromMessageHandle.state, with a 2-minute wait like pins.RadioClient.channels(only the slot and name). An empty primary name shows the modem preset (for example "LongFast"), read from the LoRa config. Message texts, PSKs,channelsandconfigBundleare never logged.chat.tsvviaStoreCodec.encodeChat/decodeChat: at most 500 messages per conversation, plus the channel names so the list still makes sense offline. Writes are debounced to 500 ms. "Clear saved data" deletes messages too.domain/ChatRules(thread routing, byte limit, conversation list, trimming, reply channel).Tests
./gradlew :app:testDebugUnitTest :app:assembleDebug :app:lintDebugpasses, with no new lint warnings.ChatRulesTest(9 tests) and chat round-trip / damaged-line tests inStoreCodecTest.Docs:
AGENTS.mdtakes messaging out of "Out of scope" and lists chat as the third allowed write.CHANGELOG.mdhas an Unreleased entry.Type of change
How was it tested?
./gradlew :app:testDebugUnitTest./gradlew :app:lintDebugChecklist
🤖 Generated with Claude Code