diff --git a/AGENTS.md b/AGENTS.md index 81fb9bb..905e01c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1871,7 +1871,7 @@ when it does not know it. | Member | Signature | |---|---| | `Send(number, text, options)` | `ssa{sv} → s` (the message's id, `ims-sms---`: this run's token — eight hex digits drawn at the daemon's start —, its start second and a counter; a later run gives the same id only if it draws the same token and starts in the same second, and a received id (`ims-sms-in---`) only with the same token, arrival second and counter; a client keys `StateChanged` by id); options: `status-report` (b). `org.freedesktop.DBus.Error.NotSupported` while `SMS_OVER_IMS` is off | -| `GetStatus()` | `→ a{sv}`: `enabled` (b, the daemon's configuration — answered before the first registration too), `smsc` (s, the service centre as of the daemon's last status snapshot, the one the frozen `GetStatus` answers from — so empty before a run's first, and when none is known), `registered` (b), `subscribers` (u). No count of the store: `GetStatus` is the open read, and a count would tell any local account when a text arrived; `List`'s length is behind the gate | +| `GetStatus()` | `→ a{sv}`: `enabled` (b, the daemon's configuration — answered before the first registration too), `smsc` (s, the service centre as of the daemon's last status snapshot, the one the frozen `GetStatus` answers from — so empty before a run's first, and when none is known), `ppi` (s, the own number in that snapshot — the frozen interface's `ppi`, made valid UTF-8 as `to` is, so a consumer needs no second call — empty while the snapshot holds none), `registered` (b), `subscribers` (u). No count of the store: `GetStatus` is the open read, and a count would tell any local account when a text arrived; `List`'s length is behind the gate | | `Subscribe()` | `→` nothing: the caller's connection receives the two signals below from now on, until it closes. It succeeds while SMS over IP is off too (only `Send` is refused then); a consumer reads `enabled` for that state | | `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 — oldest first on a synced clock (a 1970 second before the first time sync sorts first; the SC's `timestamp` is the chronology, §7.9) — each the id and the same dictionary `Received` carries (its `received` the arrival time) | | `Delete(id)` | `s`: removes a stored message; `org.freedesktop.DBus.Error.InvalidArgs` for an empty string, one over 64 bytes or one with a character other than an ASCII letter, an ASCII digit or `-`; `org.freedesktop.DBus.Error.FileNotFound` for any other string when the removal found no file; `org.freedesktop.DBus.Error.IOError`, with the system's reason, when the removal failed — a record that is there is kept | diff --git a/README.md b/README.md index 1e486a6..97b16e8 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ gain a key. | Member | Signature | |---|---| | `Send(number, text, options)` | `ssa{sv} → s` (id); options: `status-report` (b, ask the SC to report delivery). Refused with `NotSupported` while SMS over IMS is off | -| `GetStatus()` | `→ a{sv}`: `enabled` (b), `smsc` (s), `registered` (b), `subscribers` (u) | +| `GetStatus()` | `→ a{sv}`: `enabled` (b), `smsc` (s), `ppi` (s, the own number in the daemon's last status, e.g. `tel:+31612345678`), `registered` (b), `subscribers` (u) | | `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 | diff --git a/implementations/main.cpp b/implementations/main.cpp index de7bd7b..ea5edd9 100644 --- a/implementations/main.cpp +++ b/implementations/main.cpp @@ -3304,6 +3304,7 @@ void HandleMessagingMethod(GDBusConnection* conn, const gchar*, const gchar*, co // the truth g_variant_builder_add(&b, "{sv}", "enabled", g_variant_new_boolean(TheEngine->SmsEnabled() ? TRUE : FALSE)); g_variant_builder_add(&b, "{sv}", "smsc", g_variant_new_string(StatusSnap.smsc.c_str())); + g_variant_builder_add(&b, "{sv}", "ppi", g_variant_new_take_string(g_utf8_make_valid(StatusSnap.ppi.c_str(), -1))); // from a header, as `to` g_variant_builder_add(&b, "{sv}", "registered", g_variant_new_boolean(StatusSnap.registered ? TRUE : FALSE)); g_variant_builder_add(&b, "{sv}", "subscribers", g_variant_new_uint32(static_cast(Subscribers.size()))); g_dbus_method_invocation_return_value(inv, g_variant_new("(a{sv})", &b));