• ctrl/modopts.ini docs/v322_new.md exec/avatars.js update.js

    From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Sat Nov 21 11:03:05 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/5a72645ed585d5af83d9f5c1
    Modified Files:
    ctrl/modopts.ini docs/v322_new.md exec/avatars.js update.js
    Log Message:
    avatars.js: a first import reads recent messages only, each one once

    Reported by Accession on IRC: "jsexec update.js" added the AVAT-IN and
    AVAT-OUT events, and the import that followed looked like an endless
    loop.

    Two things made the first import long:

    - With no import pointer saved, it started at message 1 and read the
    whole sub: 3,728 network avatar messages of 5,233 in SYNCDATA on
    Vertrauen.
    - The starting offset was computed as total_msgs - (last_msg - pointer),
    which is far below zero when the pointer is 0 and the sub has been
    purged. MsgBase.get_msg_index() counts a negative offset from the end,
    so the loop made about last_msg failed or repeated index reads and
    imported every message twice (7,456 imports for those 3,728
    messages). The offset is now clamped to 0.

    A first import (no import_ptr in the sub's .ini file and no -ptr
    option) now begins after the newest message older than
    first_import_days, a new [avatars] option in modopts.ini (default 30,
    0 for the whole sub). Avatars in use are exported again every
    export_freq days (default 7), so the recent messages hold them. On the
    same sub that is 862 messages.

    update.js names its -noavatars option when it installs the feature.

    Tested with the import function run against the live SYNCDATA index
    (read-only) with the per-message import and the pointer file stubbed:
    first run 862 messages from the first one newer than 30 days, pointer
    saved; second run none; -ptr=0 3,728, each once (7,456 before the
    clamp). A real import into avatar files was not run.

    Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)