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
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
ImsdMessages.Bus — the GLib side of imsd-messages: the GDBus client of
|
Bus: the GDBus client, imsd's dictionaries, the notifier and the owned name
The GLib side of the app. Variant reads imsd's Received dictionary by
key and type as its SmsVariant writes it (`to`, the number the text
arrived for, a tel: URI read like the status's `ppi`; `operator`, the
SIM it arrived under), the GetStatus one with the subscriber's own
number and the SIM's operator in it (`ppi`, a tel: URI as the frozen
interface gives it; `operator`), and maps a GError to the core's error
kinds off GDBus's own mapping. Client is the Sync logic's transport:
asynchronous calls with their continuations as user data — every reply
guarded where it is delivered (OnCallDone), as are the signal handlers
and the name watch's callbacks: a throw is a fault the events hear, not
the end of the process — the calls behind imsd's polkit gate allow
interaction: Subscribe, List and Delete wait two minutes; Send has no
bound of the client's, since imsd sends the text once its prompt lets
the call through, however late, and a Send given up on would be failed
by Sync and be sent all the same; GetStatus ten seconds — (one call: the
Messaging status carries the own number, imsd reading both from one
snapshot; AGENTS.md §1 names both interfaces), the Messaging and
RegistrationChanged signals, and a watch on net.catcrafts.IMS1 whose
appeared callback is where Sync subscribes. Notifier shows one desktop
notification per conversation and replaces it as more texts arrive: one
Notify at a time per conversation, since the id to replace comes with
the answer; its default action asks the app for that conversation; the
body is escaped when the server renders markup (GetCapabilities, asked
once; Plasma and GNOME do), so a text's '<' or '&' shows as typed.
Instance owns net.catcrafts.ImsdMessages and serves
org.freedesktop.Application there, the Desktop Entry Specification's
interface of a running application: Activate, Open and ActivateAction,
each with its platform data — sent empty and not read: nothing in the
app can use an activation token yet — and one action, quit, any other
refused (the object registered before the name is asked for, so a launch
that forwards the moment the name is granted finds it; Own tells a name
another instance holds from a request that failed or was refused, and
keeps the error's words); it forwards a call to the owner. project.cpp
computes the gio flags once for the bus library, the executable and the
Decode test.
Tested: tests/Decode (every key of imsd's Received dictionary, one with
ten of them, GetStatus, the own number, the SIM's operator, the error
kinds, the markup escape, the parameters of the instance's three calls).
2026-10-17 23:45:29 +02:00
|
|
|
imsd's /net/catcrafts/IMS1 on the system bus (the Messaging interface, and
|
|
|
|
|
the frozen interface's registration signal), the decoding of its
|
Bus, Ui, main: the system's appearance, dark or light and its accent
The desktop portal's org.freedesktop.appearance settings on the session
bus say whether the system prefers dark (color-scheme 1) and which
accent colour it uses, and a flatpak may read them. Bus:Appearance
subscribes to SettingChanged and reads the namespace in one ReadAll
call, which every portal version has, so a start waits for one answer at
most, 2 s; a portal that gave no colour scheme by then — still starting,
or not on the bus yet — is asked again when its name has an owner,
without waiting, and its answer comes as a change. The canvas gained a
dark palette and takes the accent for the avatars, badges, buttons and
outgoing bubbles, with the text on it dark or light by the accent's
brightness. The app applies the theme to the window at once and keeps it
for the next one; --theme dark|light or IMSD_MESSAGES_THEME (the same
two values: another is refused on the command line and ignored in the
environment) overrides the portal's colour scheme, for benches and
desktops without a portal.
2026-10-18 03:08:03 +02:00
|
|
|
dictionaries, the desktop notifications, the app's own session-bus name and
|
2026-10-20 23:23:30 +02:00
|
|
|
the desktop portal (appearance, background). No window: the executable wires
|
Bus, Ui, main: the system's appearance, dark or light and its accent
The desktop portal's org.freedesktop.appearance settings on the session
bus say whether the system prefers dark (color-scheme 1) and which
accent colour it uses, and a flatpak may read them. Bus:Appearance
subscribes to SettingChanged and reads the namespace in one ReadAll
call, which every portal version has, so a start waits for one answer at
most, 2 s; a portal that gave no colour scheme by then — still starting,
or not on the bus yet — is asked again when its name has an owner,
without waiting, and its answer comes as a change. The canvas gained a
dark palette and takes the accent for the avatars, badges, buttons and
outgoing bubbles, with the text on it dark or light by the accent's
brightness. The app applies the theme to the window at once and keeps it
for the next one; --theme dark|light or IMSD_MESSAGES_THEME (the same
two values: another is refused on the command line and ignored in the
environment) overrides the portal's colour scheme, for benches and
desktops without a portal.
2026-10-18 03:08:03 +02:00
|
|
|
this to the UI.
|
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
|
|
|
*/
|
|
|
|
|
export module ImsdMessages.Bus;
|
|
|
|
|
export import :Variant;
|
|
|
|
|
export import :Client;
|
|
|
|
|
export import :Notifier;
|
|
|
|
|
export import :Instance;
|
Bus, Ui, main: the system's appearance, dark or light and its accent
The desktop portal's org.freedesktop.appearance settings on the session
bus say whether the system prefers dark (color-scheme 1) and which
accent colour it uses, and a flatpak may read them. Bus:Appearance
subscribes to SettingChanged and reads the namespace in one ReadAll
call, which every portal version has, so a start waits for one answer at
most, 2 s; a portal that gave no colour scheme by then — still starting,
or not on the bus yet — is asked again when its name has an owner,
without waiting, and its answer comes as a change. The canvas gained a
dark palette and takes the accent for the avatars, badges, buttons and
outgoing bubbles, with the text on it dark or light by the accent's
brightness. The app applies the theme to the window at once and keeps it
for the next one; --theme dark|light or IMSD_MESSAGES_THEME (the same
two values: another is refused on the command line and ignored in the
environment) overrides the portal's colour scheme, for benches and
desktops without a portal.
2026-10-18 03:08:03 +02:00
|
|
|
export import :Appearance;
|
2026-10-20 23:23:30 +02:00
|
|
|
export import :Background;
|