Skip to main content

Module phonemsgs

Module phonemsgs 

Source
Expand description

The phone’s messages on your computers (docs/android.md, “Messages on your computers”; docs/database.md, “The phone’s messages”; docs/porch.md, “From your phone”; research: docs/research/sms.md, phase a).

The listener (AppNotes.java, appnotes) sees each notification of another app. For the apps switched on for your computers (the phone’s SMS app unless you say otherwise; any other app, a chat’s, when you choose it), and while the part “Messages from your phone” is on, the phone writes a line per message in its own log, phone-messages/log/<device>.jsonl (lines_of, carry_into), which the sharing carries, sealed, to your other devices. A line says who wrote, when, in which conversation, and the words, cut at 1,000 characters; or only who and when, for an app set so; “a picture” for a picture, never the picture.

Never: a code or an approval (its line says a code came, and that it stays on the phone), a copy Android redacted (the same), anything of a blocked sender or of a conversation held for good, a notification its app marked secret, ongoing ones, Sioul’s own, a button or a tap. Each line is padded to a multiple of 256 bytes before it is sealed (padded): the server learns no message’s length.

A computer’s Porch lists them under “From your phone” (lines): one line per conversation, part of the day and day, once the phone let the notification through (Line::shows) and while its sender may reach you by that device’s matrix (reaches_now), never as a notification of its own, never counted. Seen is each device’s own log of lines, phone-messages/seen/<device>.jsonl, written and read as the calls’ are (calls::mark_seen, calls::read_seen with this folder): seen on one device, gone from all. A phone takes its own lines out after KEPT_DAYS; any device takes another’s out LATE_DAYS later (trim_own, trim_others), so that a phone gone for good leaves nothing behind for ever.

What the phone sends, per app, is its own choice (Choices, phone-messages.toml in its configuration), never shared.

Structs§

AppChoice
An app’s choice, with its name as last seen.
Choices
The phone’s choices ($XDG_CONFIG_HOME/sioul/phone-messages.toml): never shared, the phone decides what leaves it.
Extra
What Java says of a notification besides appnotes::Posted, in the same JSON (AppNotes.java, describe), which Posted passes over.
ExtraMessage
One message’s own, besides appnotes::Message: when it was sent (ms, 0 unsaid) and whether it carries a picture.
Line
A message as a phone’s log keeps it and the sharing carries it.
Lister
What the Porch’s lines need besides the logs.
Notice
A notification as the phone’s listener decided it, with what you chose for its app.
PorchLine
A line of the Porch’s “From your phone”: a conversation, in one part of one day, on one phone; or a code that came.
Said
One message of a Porch’s line.

Enums§

Send
What an app’s notifications send to your computers.

Constants§

CHOICES_FILE
The phone’s choices, in its configuration folder.
DAY_MS 🔒
A day, in milliseconds.
FOLDER
Their folder, in the state folder.
KEPT_DAYS
A phone takes its own lines out after this many days.
LATE_DAYS
Another device’s lines are taken out by any device this many days later.
LOG
The folder of the phones’ logs, one file per phone, written by that phone alone; shared.
NAME_MAX 🔒
A name is cut after this many characters.
PAD_STEP
Each line’s length, in bytes, is a multiple of this.
PART
The sharing’s part that carries them.
SECRET
Android’s Notification.VISIBILITY_SECRET: kept off the lock screen, kept on the phone.
SEEN_LOG
The folder of the lines marked seen, one file per device; shared. The calls’ name: their functions read and write it under this folder too.
TEXT_MAX
A message’s words are cut after this many characters.

Functions§

carry_into
A phone’s new lines added to its own log (own), under its lock, read again there: those not in it yet (by id), none past KEPT_DAYS (taken out already, it would come back), each padded. Two processes adding at once never write a line twice. Returns how many were written.
code_sender 🔒
Who a code came from, as safe to say: the last sender’s name, else the conversation’s, else the title; the app’s name when that name may hold the code itself (four digits in a row that are no phone number, a short number included), or nothing.
context 🔒
“while you slept”: the part of the day, in a few words (the calls’ words).
cut 🔒
At most max characters, “…” said where it was cut.
folder
The folder of the phones’ messages.
history
A person’s messages of the week (keys, their numbers as Sioul keys them), newest first, from every phone: a sentence each, for their sheet, never a count; codes said without them, words withheld said so. A blocked sender’s never come: they never leave the phone.
is_false 🔒
is_user 🔒
Whether a message’s sender is the person themselves, as the conversation names them.
lines
The Porch’s lines, oldest first: the messages of the last week not seen on any device, once the phone let them through and while their sender may reach you; never a blocked sender’s. One line per phone, conversation (or sender), part of the day and day; a code its own line. all are every phone’s (read_logs), oldest first.
lines_of
The lines a notification makes, none when nothing of it may leave the phone: its app off for your computers, Sioul’s own, an ongoing one, a summary, a notification its app marked secret, a blocked sender’s, a conversation held for good, what is never held (calls, alarms), a missed call (the calls’ part carries calls). A code, an approval or a copy Android redacted: one line that says a code came, without it. Otherwise one line per message of someone else’s (a conversation’s earlier messages are the same lines again: carry_into keeps each once), or one for the notification; who and when only for an app set so; never older than the lines are kept.
messages_of 🔒
A conversation’s messages from others, each a line made from line; without their own times (an older Java), its last one only, at heard. No messages: the notification itself, its title the sender.
number_key 🔒
A person’s number as Sioul keys it: the app’s tel:, else the phone’s address book’s first, else their name when it is a number; “” none.
older_than 🔒
A line older than days before now_ms, by its at; a line that does not read is kept.
one_line 🔒
A name on one line, cut: an app’s words never break Sioul’s.
padded
A line as written: its JSON padded with spaces to a multiple of PAD_STEP bytes, no newline. Two messages of different lengths under the same step weigh the same once sealed.
porch_line 🔒
reaches_now
Whether a line’s sender may reach you at now by this device’s matrix (attention): a code’s line at any time; a service’s text or an app’s own by the automatons’ row (or At once’s), shown at its times, gathered included; someone’s message by their Messages row (Mail’s for a mail app’s), a group’s by the groups’ row, Always through’s when the list holds them, at once. The app’s and the conversation’s own rows, set on the phone, are read over them. A row that lets them through at no time shows them in work and admin time, as the calls’ list does: no message is never listed. who: as this device’s lists judge their number now, else as the phone judged them.
read_file
The lines of one file, oldest first; a line that does not read (half written) is passed over.
read_logs
Every phone’s log under root (this folder), each line with its phone (device), oldest first: never a blocked sender’s, never one kept past KEPT_DAYS before now_ms (a phone that stopped sharing never takes its own out).
said_text 🔒
A message’s words as a Porch’s line says them.
trim_others
Another device’s lines kept LATE_DAYS past their week taken out here (here: this device): a phone gone for good never takes its own out. While it shares, it took them out before (trim_own). Returns how many went.
trim_own
This device’s own lines kept past KEPT_DAYS taken out of its log and of its seen log under root: the sharing then takes them out on every device. Returns how many went.
who_words 🔒
Who wrote, in words: your address books’ name for their number, else the app’s name for them (a number written as you read numbers), else “a number not in your contacts”, else “someone”.
words_of
A message’s words as they travel: trimmed, cut at TEXT_MAX characters.