Messages app for imsd messages dbus
  • C++ 94.2%
  • Shell 3.9%
  • Python 1.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf 9707c9fa26
Store: the message database on Crafter.DB
One table without an ordered column: Crafter.DB enforces the order on
every write, and a List() import after a restart can carry an older
stamp than the last row, so a conversation is sorted on read. A row
carries the plan it was written under, the SIM's country code and its
operator, a column each. Messages are looked up by imsd id (unique
across imsd's runs by its run token: an id names one message, and an
empty one — a text imsd has not answered yet — none); read marks and
deletes go per message and per conversation; every write but a Compact
is caught at this one boundary — a store that refuses one (Crafter.DB's
IOError: the disk full, the file system read-only) answers nullopt from
Add, false or a count of 0 (a row appended before its Flush failed is
tombstoned; an in-place write whose Flush failed stays in the row as the
process reads it; SetState's state and imsd's id land in place even when
a reason cannot — the id is inline in the row, 64 bytes as imsd bounds
it, one past that refused rather than thrown), and tells its
onWriteState listener once of the refusal and once of the next write
that got room, which is one that grew a file: Crafter.DB allocates its
extents, so a write that fit the ones it had (an in-place one, a short
row) is no recovery. So a refused write ends no caller's process and the
app's banner can say so. A lock file beside the table, held for the
store's life, makes a second store on the same directory throw
LockedError (the table's own lock sits on an inode a Compact replaces);
it is built on Crafter.DB's File and Os — the directory made 0700 at
every component, the file 0600 and never a symlink, a lock that fails
for any reason but another holder an IOError, not a LockedError. Every
change a call answers as made — a row id, true, a count — is committed
before the call returns, so a row Add returned is on disk. The file's
format is held by the build: static_asserts on the row's size and layout
fingerprint (Crafter.DB's Layout) and on the stored values of Direction
and MessageState, so a column changed without a version bump fails the
build and not a user's open, and an enumerator moved fails it where an
open would misread the stored states without a word.

Tested: tests/Store in a temp directory: the round trip, the sort of a
later-appended older message, the updates, the lookup by imsd id and an
erased row's, an id past imsd's bound refused, the lock from a second
open, persistence across a reopen, Compact, a row kept by a child
process that ends without a flush, the private file modes, and a write
refused under the file-size limit (told once with its reason, the rows
before it standing, an in-place write going through and telling nothing,
a state landing without its refused reason and imsd's id beside it, the
next Add after the limit's lifting telling of the recovery once), and a
Flush failing after its Append (the descriptor pointed at /dev/null for
the one write) tombstoning the row Add refused.
2026-11-18 01:12:27 +01:00
assets project: the repository skeleton 2026-10-17 23:14:00 +02:00
implementations project: the repository skeleton 2026-10-17 23:14:00 +02:00
interfaces Store: the message database on Crafter.DB 2026-11-18 01:12:27 +01:00
tests Store: the message database on Crafter.DB 2026-11-18 01:12:27 +01:00
.gitignore project: the repository skeleton 2026-10-17 23:14:00 +02:00
AGENTS.md project: the repository skeleton 2026-10-17 23:14:00 +02:00
FUNDING.yml project: the repository skeleton 2026-10-17 23:14:00 +02:00
LICENSE project: the repository skeleton 2026-10-17 23:14:00 +02:00
project.cpp Store: the message database on Crafter.DB 2026-11-18 01:12:27 +01:00
README.md project: the repository skeleton 2026-10-17 23:14:00 +02:00

imsd-messages

The SMS app for imsd on Linux phones. imsd 2.0.0 carries texts over IMS and keeps them until a messaging app takes them; this is that app. It speaks imsd's net.catcrafts.IMS1.Messaging D-Bus interface and nothing else: no ModemManager, no modem.

Nothing to install yet. The flatpak will come from the Catcrafts remote:

flatpak remote-add --if-not-exists catcrafts https://flatpak.catcrafts.net/catcrafts.flatpakrepo

Building

This project uses Crafter.Build:

crafter-build          # the executable
crafter-build test     # the unit tests
crafter-build lint     # the house-style rules

License

GPL-3.0-only - see LICENSE. The bundled font (Noto Sans) is under the SIL Open Font License 1.1, see assets/OFL.txt.

Funding

https://catcrafts.net/shop/donation - see FUNDING

Copyright (C) 2026 Catcrafts® catcrafts.net