Status system reworked

This commit is contained in:
alejo committed 2026-10-29 01:02:06 -03:00
1 parent 33567db5a3
commit a29ba6e4d2
18 files changed
+326 -345

No files matched your search

+9 -7
View File
@@ -26,14 +26,16 @@ std::optional<Status> parse(const std::string& text, std::time_t now);
std::string serialize(const Status& status);
std::optional<Status> deserialize(const std::string& text);
// Prompt and Testing tasks follow their account's wait; Uploading, Frozen and
// Done tasks do not.
bool followsAccountWait(StatusKind kind);
// Prompt and Testing show as they are, with "(account-waiting)" appended while
// their account waits. Other statuses are shown without a note.
bool showsAccountWaiting(StatusKind kind);
// The status to show for a task. If its account has a wait, the tasks that
// follow it show Wait until then and Limit reset after; otherwise the stored
// status is used (see effective).
Status resolve(const Status& stored, const std::optional<std::time_t>& accountWait, std::time_t now);
// The status to show for a task. A task set to Wait on an account waits for the
// account: Wait until the account's wait ends, Limit reset after that (or if the
// account is not waiting). `accountWait` is when the account's wait ends (ended).
// Everything else shows its stored status (see effective).
Status resolve(const Status& stored, bool hasAccount, const std::optional<std::time_t>& accountWait,
std::time_t now);
// The status shown to the user: an expired wait becomes LimitReset.
Status effective(const Status& status, std::time_t now);