Nostro/implementations/Nostro-Bus.cpp

557 lines
20 KiB
C++
Raw Permalink Normal View History

2026-11-01 18:35:23 +01:00
// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
module;
#include <errno.h>
#include <systemd/sd-bus.h>
module Nostro:Bus_impl;
import std;
import :Bus;
import :Account;
import :Bunq;
import :Currency;
import :Transaction;
using namespace Nostro;
using namespace Nostro::Bus;
std::int32_t Bus::ThrowOnSdBus(std::int32_t result, std::string_view what) {
if(result < 0) {
throw std::system_error(-result, std::generic_category(), std::format("cannot {}", what));
}
return result;
}
namespace {
// A C string sd-bus handed out, as a string; null is empty.
// lint-disable-next-line no-char-pointer
std::string Text(const char* text) {
return text ? std::string(text) : std::string();
}
}
std::string Bus::Sender(sd_bus_message* message) {
return Text(sd_bus_message_get_sender(message));
}
std::string Bus::Member(sd_bus_message* message) {
return Text(sd_bus_message_get_member(message));
}
std::string Bus::ErrorName(const sd_bus_error& error) {
return Text(error.name);
}
std::string Bus::ErrorMessage(const sd_bus_error& error) {
return Text(error.message);
}
bool Bus::IsSensitive(std::string_view member) {
return std::ranges::any_of(methods, [member](const Method& method) { return method.member == member && method.sensitive; });
}
std::string Bus::ReadText(sd_bus_message* message, char type) {
// sd-bus hands out strings as C strings into the message, valid while it lives.
// lint-disable-next-line no-char-pointer
const char* value = nullptr;
ThrowOnSdBus(sd_bus_message_read_basic(message, type, &value), "read a string");
return Text(value);
}
void Bus::BusUnref::operator()(sd_bus* bus) const {
sd_bus_flush_close_unref(bus);
}
void Bus::MessageUnref::operator()(sd_bus_message* message) const {
sd_bus_message_unref(message);
}
Bus::Error::~Error() {
sd_bus_error_free(&error);
}
std::vector<sd_bus_vtable> Bus::Vtable(std::span<const Method> table, const std::function<sd_bus_message_handler_t(std::string_view member)>& handler) {
std::vector<sd_bus_vtable> vtable = {SD_BUS_VTABLE_START(0)};
for(const Method& method : table) {
const std::uint64_t flags = SD_BUS_VTABLE_UNPRIVILEGED | (method.sensitive ? SD_BUS_VTABLE_SENSITIVE : 0);
sd_bus_vtable entry = SD_BUS_METHOD_WITH_NAMES_OFFSET(method.member.data(), method.in.data(), "", method.out.data(), "", handler(method.member), 0, flags);
// The names of the arguments and of the reply, which the macro would only take as literals to join.
entry.x.method.names = method.names.data();
vtable.push_back(entry);
}
vtable.push_back(SD_BUS_VTABLE_END);
return vtable;
}
void Bus::Enter(sd_bus_message* message, char type, std::string_view contents) {
// Every message was checked against its signature before it got here, so the container is there.
ThrowOnSdBus(sd_bus_message_enter_container(message, type, std::string(contents).c_str()), "read a container");
}
void Bus::Leave(sd_bus_message* message) {
ThrowOnSdBus(sd_bus_message_exit_container(message), "leave a container");
}
void Bus::Open(sd_bus_message* message, char type, std::string_view contents) {
ThrowOnSdBus(sd_bus_message_open_container(message, type, std::string(contents).c_str()), "open a container");
}
void Bus::Close(sd_bus_message* message) {
ThrowOnSdBus(sd_bus_message_close_container(message), "close a container");
}
namespace {
// A basic value, or an exception when the message holds something else or has ended.
template<typename T>
T ReadBasic(sd_bus_message* message, char type) {
T value{};
ThrowOnSdBus(sd_bus_message_read_basic(message, type, &value), "read a value");
return value;
}
std::chrono::system_clock::time_point FromMicroseconds(std::int64_t microseconds) {
return std::chrono::system_clock::time_point(std::chrono::microseconds(microseconds));
}
std::int64_t ToMicroseconds(std::chrono::system_clock::time_point time) {
return std::chrono::duration_cast<std::chrono::microseconds>(time.time_since_epoch()).count();
}
}
void Bus::Wire<std::string>::Append(sd_bus_message* message, const std::string& value) {
// D-Bus carries UTF-8 only: sd-bus refuses anything else.
const std::int32_t result = sd_bus_message_append_basic(message, 's', value.c_str());
if(result == -EINVAL) {
throw std::invalid_argument("text that is not UTF-8 cannot be sent to nostrod");
}
ThrowOnSdBus(result, "append a string");
}
std::string Bus::Wire<std::string>::Read(sd_bus_message* message) {
return ReadText(message, 's');
}
void Bus::Wire<bool>::Append(sd_bus_message* message, bool value) {
const std::int32_t b = value ? 1 : 0;
ThrowOnSdBus(sd_bus_message_append_basic(message, 'b', &b), "append a boolean");
}
bool Bus::Wire<bool>::Read(sd_bus_message* message) {
return ReadBasic<std::int32_t>(message, 'b') != 0;
}
void Bus::Wire<std::uint32_t>::Append(sd_bus_message* message, std::uint32_t value) {
ThrowOnSdBus(sd_bus_message_append_basic(message, 'u', &value), "append a number");
}
std::uint32_t Bus::Wire<std::uint32_t>::Read(sd_bus_message* message) {
return ReadBasic<std::uint32_t>(message, 'u');
}
void Bus::Wire<std::int64_t>::Append(sd_bus_message* message, std::int64_t value) {
ThrowOnSdBus(sd_bus_message_append_basic(message, 'x', &value), "append a number");
}
std::int64_t Bus::Wire<std::int64_t>::Read(sd_bus_message* message) {
return ReadBasic<std::int64_t>(message, 'x');
}
void Bus::Wire<std::uint64_t>::Append(sd_bus_message* message, std::uint64_t value) {
ThrowOnSdBus(sd_bus_message_append_basic(message, 't', &value), "append a number");
}
std::uint64_t Bus::Wire<std::uint64_t>::Read(sd_bus_message* message) {
return ReadBasic<std::uint64_t>(message, 't');
}
void Bus::Wire<std::chrono::system_clock::time_point>::Append(sd_bus_message* message, std::chrono::system_clock::time_point value) {
Wire<std::int64_t>::Append(message, ToMicroseconds(value));
}
std::chrono::system_clock::time_point Bus::Wire<std::chrono::system_clock::time_point>::Read(sd_bus_message* message) {
return FromMicroseconds(Wire<std::int64_t>::Read(message));
}
void Bus::Wire<Currency>::Append(sd_bus_message* message, Currency value) {
Wire<std::string>::Append(message, std::string(GetCurrencyCode(value)));
}
Currency Bus::Wire<Currency>::Read(sd_bus_message* message) {
return GetCurrency(Wire<std::string>::Read(message));
}
void Bus::Wire<Account>::Append(sd_bus_message* message, const Account& value) {
Open(message, 'r', contents);
Bus::Append(message, value.name);
Bus::Append(message, value.bic);
Bus::Append(message, value.iban);
Bus::Append(message, value.currency);
Bus::Append(message, value.balance);
Close(message);
}
Account Bus::Wire<Account>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
Account value{};
value.name = Bus::Read<std::string>(message);
value.bic = Bus::Read<std::string>(message);
value.iban = Bus::Read<std::string>(message);
value.currency = Bus::Read<Currency>(message);
value.balance = Bus::Read<std::int64_t>(message);
Leave(message);
return value;
}
void Bus::Wire<Transaction>::Append(sd_bus_message* message, const Transaction& value) {
Open(message, 'r', contents);
Bus::Append(message, value.name);
Bus::Append(message, value.bic);
Bus::Append(message, value.iban);
Bus::Append(message, value.description);
Bus::Append(message, value.currency);
Bus::Append(message, value.amount);
Bus::Append(message, value.timePoint);
Bus::Append(message, value.id);
Bus::Append(message, value.kind);
Close(message);
}
Transaction Bus::Wire<Transaction>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
Transaction value{};
value.name = Bus::Read<std::string>(message);
value.bic = Bus::Read<std::string>(message);
value.iban = Bus::Read<std::string>(message);
value.description = Bus::Read<std::string>(message);
value.currency = Bus::Read<Currency>(message);
value.amount = Bus::Read<std::int64_t>(message);
value.timePoint = Bus::Read<std::chrono::system_clock::time_point>(message);
value.id = Bus::Read<std::string>(message);
value.kind = Bus::Read<std::string>(message);
Leave(message);
return value;
}
void Bus::Wire<BunqLabel>::Append(sd_bus_message* message, const BunqLabel& value) {
Open(message, 'r', contents);
Bus::Append(message, value.name);
Bus::Append(message, value.iban);
Close(message);
}
BunqLabel Bus::Wire<BunqLabel>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
BunqLabel value;
value.name = Bus::Read<std::string>(message);
value.iban = Bus::Read<std::string>(message);
Leave(message);
return value;
}
void Bus::Wire<BunqPaymentRequest>::Append(sd_bus_message* message, const BunqPaymentRequest& value) {
Open(message, 'r', contents);
Bus::Append(message, value.id);
Bus::Append(message, value.status);
Bus::Append(message, value.counterparty);
Bus::Append(message, value.currency);
Bus::Append(message, value.amount);
Bus::Append(message, value.amountPaid);
Bus::Append(message, value.description);
Bus::Append(message, value.created);
Bus::Append(message, value.shareUrl);
Close(message);
}
BunqPaymentRequest Bus::Wire<BunqPaymentRequest>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
BunqPaymentRequest value{};
value.id = Bus::Read<std::uint64_t>(message);
value.status = Bus::Read<std::string>(message);
value.counterparty = Bus::Read<BunqLabel>(message);
value.currency = Bus::Read<Currency>(message);
value.amount = Bus::Read<std::int64_t>(message);
value.amountPaid = Bus::Read<std::optional<std::int64_t>>(message);
value.description = Bus::Read<std::string>(message);
value.created = Bus::Read<std::chrono::system_clock::time_point>(message);
value.shareUrl = Bus::Read<std::string>(message);
Leave(message);
return value;
}
void Bus::Wire<BunqIncomingRequest>::Append(sd_bus_message* message, const BunqIncomingRequest& value) {
Open(message, 'r', contents);
Bus::Append(message, value.id);
Bus::Append(message, value.status);
Bus::Append(message, value.type);
Bus::Append(message, value.counterparty);
Bus::Append(message, value.currency);
Bus::Append(message, value.amount);
Bus::Append(message, value.description);
Bus::Append(message, value.created);
Close(message);
}
BunqIncomingRequest Bus::Wire<BunqIncomingRequest>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
BunqIncomingRequest value{};
value.id = Bus::Read<std::uint64_t>(message);
value.status = Bus::Read<std::string>(message);
value.type = Bus::Read<std::string>(message);
value.counterparty = Bus::Read<BunqLabel>(message);
value.currency = Bus::Read<Currency>(message);
value.amount = Bus::Read<std::int64_t>(message);
value.description = Bus::Read<std::string>(message);
value.created = Bus::Read<std::chrono::system_clock::time_point>(message);
Leave(message);
return value;
}
void Bus::Wire<BunqSchedule>::Append(sd_bus_message* message, const BunqSchedule& value) {
Open(message, 'r', contents);
Bus::Append(message, value.start);
Bus::Append(message, value.end);
Bus::Append(message, value.unit);
Bus::Append(message, value.every);
Bus::Append(message, value.status);
Bus::Append(message, value.next);
Close(message);
}
BunqSchedule Bus::Wire<BunqSchedule>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
BunqSchedule value;
value.start = Bus::Read<std::chrono::system_clock::time_point>(message);
value.end = Bus::Read<std::optional<std::chrono::system_clock::time_point>>(message);
value.unit = Bus::Read<std::string>(message);
value.every = Bus::Read<std::uint32_t>(message);
value.status = Bus::Read<std::string>(message);
value.next = Bus::Read<std::optional<std::chrono::system_clock::time_point>>(message);
Leave(message);
return value;
}
void Bus::Wire<BunqScheduledPayment>::Append(sd_bus_message* message, const BunqScheduledPayment& value) {
Open(message, 'r', contents);
Bus::Append(message, value.id);
Bus::Append(message, value.counterparty);
Bus::Append(message, value.currency);
Bus::Append(message, value.amount);
Bus::Append(message, value.description);
Bus::Append(message, value.schedule);
Close(message);
}
BunqScheduledPayment Bus::Wire<BunqScheduledPayment>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
BunqScheduledPayment value{};
value.id = Bus::Read<std::uint64_t>(message);
value.counterparty = Bus::Read<BunqLabel>(message);
value.currency = Bus::Read<Currency>(message);
value.amount = Bus::Read<std::int64_t>(message);
value.description = Bus::Read<std::string>(message);
value.schedule = Bus::Read<BunqSchedule>(message);
Leave(message);
return value;
}
void Bus::Wire<BunqDraftPayment::Entry>::Append(sd_bus_message* message, const BunqDraftPayment::Entry& value) {
Open(message, 'r', contents);
Bus::Append(message, value.counterparty);
Bus::Append(message, value.currency);
Bus::Append(message, value.amount);
Bus::Append(message, value.description);
Close(message);
}
BunqDraftPayment::Entry Bus::Wire<BunqDraftPayment::Entry>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
BunqDraftPayment::Entry value{};
value.counterparty = Bus::Read<BunqLabel>(message);
value.currency = Bus::Read<Currency>(message);
value.amount = Bus::Read<std::int64_t>(message);
value.description = Bus::Read<std::string>(message);
Leave(message);
return value;
}
void Bus::Wire<BunqDraftPayment>::Append(sd_bus_message* message, const BunqDraftPayment& value) {
Open(message, 'r', contents);
Bus::Append(message, value.id);
Bus::Append(message, value.status);
Bus::Append(message, value.createdBy);
Bus::Append(message, value.entries);
Bus::Append(message, value.updated);
Close(message);
}
BunqDraftPayment Bus::Wire<BunqDraftPayment>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
BunqDraftPayment value{};
value.id = Bus::Read<std::uint64_t>(message);
value.status = Bus::Read<std::string>(message);
value.createdBy = Bus::Read<std::string>(message);
value.entries = Bus::Read<std::vector<BunqDraftPayment::Entry>>(message);
value.updated = Bus::Read<std::string>(message);
Leave(message);
return value;
}
void Bus::Wire<BunqCard>::Append(sd_bus_message* message, const BunqCard& value) {
Open(message, 'r', contents);
Bus::Append(message, value.id);
Bus::Append(message, value.kind);
Bus::Append(message, value.productType);
Bus::Append(message, value.status);
Bus::Append(message, value.orderStatus);
Bus::Append(message, value.nameOnCard);
Bus::Append(message, value.secondLine);
Bus::Append(message, value.lastFour);
Bus::Append(message, value.expiry);
Bus::Append(message, value.iban);
Close(message);
}
BunqCard Bus::Wire<BunqCard>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
BunqCard value{};
value.id = Bus::Read<std::uint64_t>(message);
value.kind = Bus::Read<std::string>(message);
value.productType = Bus::Read<std::string>(message);
value.status = Bus::Read<std::string>(message);
value.orderStatus = Bus::Read<std::string>(message);
value.nameOnCard = Bus::Read<std::string>(message);
value.secondLine = Bus::Read<std::string>(message);
value.lastFour = Bus::Read<std::string>(message);
value.expiry = Bus::Read<std::string>(message);
value.iban = Bus::Read<std::string>(message);
Leave(message);
return value;
}
void Bus::Wire<ConnectorSummary>::Append(sd_bus_message* message, const ConnectorSummary& value) {
Open(message, 'r', contents);
Bus::Append(message, value.name);
Bus::Append(message, value.bank);
Bus::Append(message, value.environment);
Bus::Append(message, value.auth);
Bus::Append(message, value.working);
Close(message);
}
ConnectorSummary Bus::Wire<ConnectorSummary>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
ConnectorSummary value;
value.name = Bus::Read<std::string>(message);
value.bank = Bus::Read<std::string>(message);
value.environment = Bus::Read<std::string>(message);
value.auth = Bus::Read<std::string>(message);
value.working = Bus::Read<bool>(message);
Leave(message);
return value;
}
void Bus::Wire<ConnectorAccounts>::Append(sd_bus_message* message, const ConnectorAccounts& value) {
Open(message, 'r', contents);
Bus::Append(message, value.name);
Bus::Append(message, value.bank);
Bus::Append(message, value.accounts);
Close(message);
}
ConnectorAccounts Bus::Wire<ConnectorAccounts>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
ConnectorAccounts value;
value.name = Bus::Read<std::string>(message);
value.bank = Bus::Read<std::string>(message);
value.accounts = Bus::Read<std::vector<Account>>(message);
Leave(message);
return value;
}
void Bus::Wire<ConnectorCards>::Append(sd_bus_message* message, const ConnectorCards& value) {
Open(message, 'r', contents);
Bus::Append(message, value.name);
Bus::Append(message, value.bank);
Bus::Append(message, value.cards);
Close(message);
}
ConnectorCards Bus::Wire<ConnectorCards>::Read(sd_bus_message* message) {
Enter(message, 'r', contents);
ConnectorCards value;
value.name = Bus::Read<std::string>(message);
value.bank = Bus::Read<std::string>(message);
value.cards = Bus::Read<std::vector<BunqCard>>(message);
Leave(message);
return value;
}
void Bus::AppendQuery(sd_bus_message* message, const TransactionQuery& query) {
Open(message, 'a', "{sv}");
const auto entry = [message](std::string_view key, std::string_view type, const auto& value) {
Open(message, 'e', "sv");
Bus::Append(message, std::string(key));
Open(message, 'v', type);
Bus::Append(message, value);
Close(message);
Close(message);
};
if(!query.search.empty()) {
entry("search", "s", query.search);
}
if(query.amount) {
entry("amount", "x", *query.amount);
}
if(query.from != std::chrono::system_clock::time_point::min()) {
entry("from", "x", query.from);
}
if(query.to != std::chrono::system_clock::time_point::max()) {
entry("to", "x", query.to);
}
entry("limit", "t", static_cast<std::uint64_t>(query.limit));
feat(app): add the Nostro app, a window for phones and desktops Linux phones have no banking apps, and a command line is no answer on a phone. The app does everything the nostro command does and, like it, only talks to nostrod: it holds no key and no token. - Nostro.Ui, a toolkit whose screens are functions that fill a frame, ported from imsd-messages ca5cd72d; Nostro.App, the app's state, forms and screens; Nostro.Ui.Shell, which puts them on a Wayland window with Crafter.Graphics; nostro-app; and Nostro.DebugCommands for the --debug-api build. - Client: every method also in an asynchronous form for an sd-event loop, with DaemonMissing and OutcomeUnknown. - nostrod's Flatpak is net.catcrafts.Nostrod now and the app takes net.catcrafts.Nostro; install.sh moves the state. The app's Flatpak, both Flatpaks cross-built for aarch64, and the licence texts they carry. - nostro-fake-system, a made-up bus and bank with a real nostrod on them, to look at the app against. The README's screenshots are taken on it. - The nostro command: an API key's environment is the key's own to say, so --sandbox is for bunq-oauth alone, and a virtual card is listed as VIRTUAL. The published contract changes in three places, before any release (design rule 10): - Transactions' query takes `stored`: answered from what nostrod has stored, without asking the bank. The app searches with it; before, every search was a call to bunq. - AddBunq's `environment` no longer chooses over what the key says of itself: a key of the other environment is refused. - SetCardStatus refuses to freeze or unfreeze a virtual card. bunq reports one as DEACTIVATED however well it pays, and leaves it as it is when asked, without an error. The app is GPL-3.0-only, the library stays LGPL-3.0-only, and no code moved from one to the other (design rule 13). Transaction's schema is unchanged. Verified: the 17 tests pass with every line, function and region of what they link run, and the five lint runs are clean. Every screen was looked at on the made-up system, at a phone's and a desktop's sizes in the light and the dark look, on Plasma under Wayland. What is said of bunq's cards comes from its sandbox, with throwaway users, and from one real virtual card. Known to have been used against production: connecting, and reading accounts, payments and cards. Not known to have been tried: a payment from the app against bunq, OAuth against bunq, and anything on a phone. Building the app takes --graphics=, a Crafter.Graphics checkout on its branch claude/nostro-app, until that branch is merged and pinned here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 12:27:14 +01:00
if(query.stored) {
entry("stored", "b", true);
}
2026-11-01 18:35:23 +01:00
Close(message);
}
TransactionQuery Bus::ReadQuery(sd_bus_message* message) {
TransactionQuery query;
Enter(message, 'a', "{sv}");
while(ThrowOnSdBus(sd_bus_message_at_end(message, 0), "read a query") == 0) {
Enter(message, 'e', "sv");
const std::string key = Bus::Read<std::string>(message);
if(key == "search") {
Enter(message, 'v', "s");
query.search = Bus::Read<std::string>(message);
Leave(message);
} else if(key == "amount") {
Enter(message, 'v', "x");
query.amount = Bus::Read<std::int64_t>(message);
Leave(message);
} else if(key == "from") {
Enter(message, 'v', "x");
query.from = Bus::Read<std::chrono::system_clock::time_point>(message);
Leave(message);
} else if(key == "to") {
Enter(message, 'v', "x");
query.to = Bus::Read<std::chrono::system_clock::time_point>(message);
Leave(message);
} else if(key == "limit") {
Enter(message, 'v', "t");
query.limit = Bus::Read<std::uint64_t>(message);
Leave(message);
feat(app): add the Nostro app, a window for phones and desktops Linux phones have no banking apps, and a command line is no answer on a phone. The app does everything the nostro command does and, like it, only talks to nostrod: it holds no key and no token. - Nostro.Ui, a toolkit whose screens are functions that fill a frame, ported from imsd-messages ca5cd72d; Nostro.App, the app's state, forms and screens; Nostro.Ui.Shell, which puts them on a Wayland window with Crafter.Graphics; nostro-app; and Nostro.DebugCommands for the --debug-api build. - Client: every method also in an asynchronous form for an sd-event loop, with DaemonMissing and OutcomeUnknown. - nostrod's Flatpak is net.catcrafts.Nostrod now and the app takes net.catcrafts.Nostro; install.sh moves the state. The app's Flatpak, both Flatpaks cross-built for aarch64, and the licence texts they carry. - nostro-fake-system, a made-up bus and bank with a real nostrod on them, to look at the app against. The README's screenshots are taken on it. - The nostro command: an API key's environment is the key's own to say, so --sandbox is for bunq-oauth alone, and a virtual card is listed as VIRTUAL. The published contract changes in three places, before any release (design rule 10): - Transactions' query takes `stored`: answered from what nostrod has stored, without asking the bank. The app searches with it; before, every search was a call to bunq. - AddBunq's `environment` no longer chooses over what the key says of itself: a key of the other environment is refused. - SetCardStatus refuses to freeze or unfreeze a virtual card. bunq reports one as DEACTIVATED however well it pays, and leaves it as it is when asked, without an error. The app is GPL-3.0-only, the library stays LGPL-3.0-only, and no code moved from one to the other (design rule 13). Transaction's schema is unchanged. Verified: the 17 tests pass with every line, function and region of what they link run, and the five lint runs are clean. Every screen was looked at on the made-up system, at a phone's and a desktop's sizes in the light and the dark look, on Plasma under Wayland. What is said of bunq's cards comes from its sandbox, with throwaway users, and from one real virtual card. Known to have been used against production: connecting, and reading accounts, payments and cards. Not known to have been tried: a payment from the app against bunq, OAuth against bunq, and anything on a phone. Building the app takes --graphics=, a Crafter.Graphics checkout on its branch claude/nostro-app, until that branch is merged and pinned here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 12:27:14 +01:00
} else if(key == "stored") {
Enter(message, 'v', "b");
query.stored = Bus::Read<bool>(message);
Leave(message);
2026-11-01 18:35:23 +01:00
} else {
ThrowOnSdBus(sd_bus_message_skip(message, "v"), "skip an unknown query key");
}
Leave(message);
}
Leave(message);
return query;
}