imsd, engine: a received text records the subscriber it arrived for
The Messaging interface gave a received text with its sender and the service centre but not the subscriber it was for. A consumer completing a national-form sender with a country code had to take the code from the daemon's status at import time, which is the wrong moment: the daemon keeps a text on disk until an app deletes it, so the app that imports it after a SIM change knows only the new SIM's code, and a national number under the old SIM's plan is keyed, and replied to, under the new one — another subscriber. Only the daemon knows at receipt which subscriber a text arrived for. The stored record and the Received and List dictionaries carry it as `to`: the own number the daemon holds at the moment of receipt — the first tel: P-Associated-URI of this run's latest answer to a fresh registration, a resume or a reconnect that carried one (a periodic refresh's answer is not read for it) and, until the first such, the state file's once a resume attempt has taken it up. The key is absent while the daemon holds none. It is additive: an app that does not know it ignores it, and a record without it reads as before. The value comes from a header, so the emission makes it valid UTF-8, as it does a failed submission's reason. Tested: tests/Engine, the record round trip with `to` and a record without it.
This commit is contained in:
parent
910e2594a0
commit
04c615fc15
5 changed files with 24 additions and 12 deletions
|
|
@ -157,7 +157,7 @@ gain a key.
|
|||
| `Subscribe()` | `→` nothing: the calling connection receives `Received` and `StateChanged` from now on (unicast, never broadcast: to subscribers, and a submission's `sent` / `failed` also to its `Send` caller); subscribe again when imsd's name reappears on the bus |
|
||||
| `List()` | `→ a(sa{sv})`: the stored messages it can read, by the arrival second on the phone's wall clock, then within a run the sequence number (a 1970 clock before the first time sync sorts first; the SC's `timestamp` is the real chronology), each the id and the dictionary `Received` carries |
|
||||
| `Delete(id)` | `s`: removes a stored message |
|
||||
| `Received` | `s a{sv}` (id, message: `from`, `text`, `timestamp` (the SC's, as `2026-10-16T22:50:00+02:00`), `received` (x), `sc`, `class` (i, -1 none), `pid` (y), `dcs` (y), `segments` (i), `message-waiting` (b), `port-dst`/`port-src` (u, when addressed to a port), `data` (ay, 8-bit data), `pdu` (ay, the SMS-DELIVER as received; of a concatenated message, the segment that completed it)) |
|
||||
| `Received` | `s a{sv}` (id, message: `from`, `text`, `timestamp` (the SC's, as `2026-10-16T22:50:00+02:00`), `received` (x), `sc`, `to` (when the daemon held an own number at receipt: that number, e.g. `tel:+31612345678`), `class` (i, -1 none), `pid` (y), `dcs` (y), `segments` (i), `message-waiting` (b), `port-dst`/`port-src` (u, when addressed to a port), `data` (ay, 8-bit data), `pdu` (ay, the SMS-DELIVER as received; of a concatenated message, the segment that completed it)) |
|
||||
| `StateChanged` | `s s s` (id, state, reason): `sent` (every segment accepted by the SC), `failed` (why), and with a status report `delivered` (every segment), `delivery-pending`, `delivery-failed` — each speaks for the whole message, never for one segment, and `delivery-pending` can come more than once |
|
||||
|
||||
`Send`, `Subscribe`, `List` and `Delete` are gated by polkit's `net.catcrafts.IMS1.Messaging`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue