• Remember the last e-mail message a user read, to resume reading there

    From Rob Swindell@1:103/705 to GitLab issue in main/sbbs on Tue Sep 29 19:30:25 2026
    open https://gitlab.synchro.net/main/sbbs/-/work_items/1271

    ## Summary

    Remember the last e-mail message a user viewed, so they can quit the mail reader, go do something else, and come back to continue from that message.

    ## Current behavior

    Sub-boards keep a per-user "last read" pointer, so reading can resume where
    it left off. Mail has no equivalent. Each message carries its own read
    flag (`MSG_READ`), which the "un-read mail only" reading mode uses, but
    that only finds messages never read before: the message a user was on when
    they quit has already been marked read. `readmail()` starts at the first message in the list every time, so a user reading through older mail has to find their place again.

    ## Proposal

    * Store the number of the last mail message the user viewed ("your mail"),
    per user, alongside the sub-board pointers in `data/user/####.subs`. The
    section name needs to be one that cannot also be a sub-board internal
    code.
    * When the mail reader starts (not in un-read-only mode), begin at that
    message if it is still there, or else the next one after it.
    * Make it available to JavaScript mail readers, as the sub-board pointers
    are, so they can resume the same way.

    Possibly also for sent mail, which is read the same way.

    Related: #1027 (a user setting to read new or un-read netmail on login).

    -- *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Thu Oct 22 18:31:45 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1271#note_10670

    The "current behavior" above describes only the built-in (C++) mail reader. Which reader runs depends on the configured Read Mail loadable module (SCFG->System->Loadable Modules) and its access requirements. Vertrauen, for example, has `readmail=msglist mail -preview` with `ANSI AND COLS 80 AND !SYSOP`.

    `msglist.js` already supports resuming, as an opt-in (`track_last_read_mail` in `modopts.ini [msglist]`, default `false`, added in 93d4bad3ee, 2020-04-13):

    - While the list is open, the selected message's number is saved as `last_read_mail` in the user's properties file (`data/user/####.ini`), in sections `[msglist:mail:your]`, `[msglist:mail:sent]`, and `[msglist:mail:all]`.
    - With the option enabled, the next run starts the list on that message. With it disabled, the stored value is discarded at startup, although it is still written on every run.
    - Within one run, returning from a message to the list keeps the cursor on the message just read.

    The built-in reader lists the messages and then starts at the first one.

    Points for the implementation:

    1. **Storage:** instead of a new pointer in `data/user/####.subs`, have the built-in reader read and write the existing `last_read_mail` values in `####.ini`, so both readers resume from the same message rather than keeping two pointers that drift apart. That also covers sent mail (and all-mail, for sysops).
    2. **List-then-read flow:** after listing, the built-in reader would make the remembered message (or the next one, if it was deleted) the current message, without displaying it, matching what `msglist.js` does.
    3. **Default:** decide whether resuming stays opt-in as in `msglist.js`, or becomes the default for both readers.

    - *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Thu Oct 22 18:32:49 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1271#note_10673

    Updated the description: the proposal now reuses the existing `last_read_mail` keys in `data/user/####.ini` (shared with `msglist.js`) instead of adding a pointer to `data/user/####.subs`.

    - *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Thu Oct 22 18:34:12 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1271#note_10675

    Revised the description again: the pointers go in the `[mail]` section of `data/user/####.ini` (already used by the built-in reader for `savepath`) as `last_read_your`, `last_read_sent`, and `last_read_all`, rather than in `msglist.js`'s own `[msglist:mail:*]` sections. `msglist.js` would switch to the `[mail]` keys, falling back once to its old values.

    - *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)