Model: messages, conversations and the banner
The GLib-free shape of what the app shows: imsd's state words (each applies as it comes: imsd gives a message's words in order, the submission's first and a status report's after sent, its AGENTS.md section 8.4); a received text (the dictionary of imsd's AGENTS.md section 8.4) becoming a message keyed by the sender's address completed with the code of the number it arrived for (imsd's `to`, the subscriber's own number at receipt — the record's: a text imsd kept across a SIM change would otherwise take the new SIM's code) or, lacking one, of the service centre that delivered it, the own number's code — none where the centre's stood in, which names no SIM's country — and the operator of the SIM it arrived under (imsd's `operator`) its plan (Number's SimPlan), and whose sort time is the service centre's stamp, else its arrival; the short message type 0, which a phone acknowledges and discards (IsType0, TS 23.040 9.2.3.9); the grouping into conversations newest first, unread counting incoming unread only; and the one-line banner from what the app knows about imsd: absent, connecting (GetStatus has not answered since imsd appeared), off, subscribe refused, unregistered, the store refusing a write (its disk full: texts wait; a send still goes), subscribe failed otherwise — what blocks sending before what only costs live updates — messages it may not delete. Tested: tests/Model.
This commit is contained in:
parent
335b27b72d
commit
724cd409ba
4 changed files with 358 additions and 0 deletions
|
|
@ -146,6 +146,18 @@ export namespace ImsdMessages {
|
|||
return cleaned;
|
||||
}
|
||||
|
||||
// A SIM's dialling plan as the app knows it: the country code of its
|
||||
// own number ("" while that is not known: a service centre's code
|
||||
// completes a key meanwhile and is never a plan's, since an MVNO's
|
||||
// centre can be abroad) and its operator (imsd's `operator`: the SIM's
|
||||
// MCC, then its MNC; "" when imsd gave none), whose short codes are its
|
||||
// own.
|
||||
struct SimPlan {
|
||||
std::string code;
|
||||
std::string operatorId;
|
||||
friend bool operator==(const SimPlan&, const SimPlan&) = default;
|
||||
};
|
||||
|
||||
// The number as the UI shows it: "+31 612345678" for E.164, the key
|
||||
// itself for everything else.
|
||||
std::string DisplayNumber(std::string_view key) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue