Commit graph imsd-messages/interfaces
Author SHA1 Message Date
692f550e31
Number: the conversation key of an address
An address becomes one conversation key. A number in international form
becomes E.164, and one in national form gets the given country code in
front — nine digits or more with a leading 0, or eight or more without
one, as a plan without a trunk prefix writes its numbers, the latter
only while the result is no longer than a number can be; the country
code of an E.164 number is found by the ITU length rule; short codes and
alphanumeric senders are their own keys. The display form puts a space
after the country code.

The key groups; a text goes to the address as dialled (DialledNumber:
the separators gone, a parenthesised trunk zero after a country code
dropped — not after Italy's code or San Marino's, where no zero is a
trunk prefix (a landline's is part of its number, a mobile has none):
such an address names two numbers and is none — nothing added), since
imsd sends a national number or a short code with the type unknown and
the network reads it by its own dialling plan — a country code completed
for the key would be dialled for real. A national number's leading 0 is
taken for the trunk prefix and goes when the country code is added — not
under Italy's code or San Marino's, where it is the number's and stays.
The key's known limits are of grouping: a number written with its
country code and no '+' is completed as a national one, one of a plan
whose trunk prefix is not a lone 0 (Hungary's 06, Russia's 8) is
completed wrongly, and a national number shorter than those lengths
(Iceland's seven digits) stays its digits.

Tested: tests/Number, thirty-two normalisation cases (the parenthesised
trunk zero of an international number, one after San Marino's code left
as no number, a national number's zero kept under Italy's code and San
Marino's, the numbers without a trunk prefix and both rules' shortest
numbers among them), twelve dialled forms (two with a zero in
parentheses after Italy's code, left as typed, among them), the country
codes of one-, two- and three-digit countries, the display forms.
2026-11-17 06:14:18 +01:00
3d635a6f9d
project: the repository skeleton
The SMS app for imsd's net.catcrafts.IMS1.Messaging interface starts
here: the licence (GPL-3.0-only), FUNDING.yml, README and AGENTS, a
project.cpp with the three build products (imsd-messages-core: std and
Crafter.DB; imsd-messages-bus: GLib; the imsd-messages executable),
their module units as stubs, the version constant, the bundled Noto Sans
font with its OFL text, and the first test. This commit is the base every
later range is reviewed against.

Tested: crafter-build builds the three products and --version answers,
crafter-build test passes the one test, lint and format --check are clean
on every text rule and on the AST rules for the eleven files without a
global module fragment; the four files that include gio/gio.h are not
parsed by the lint driver's libclang (no C++ standard library on its
include path: 'type_traits' file not found), which is a Crafter.Build
matter.
2026-10-17 23:14:00 +02:00