Skip to content
  • rswindell's avatar
    New JS bbs methods: · b4d31140
    rswindell authored
    - bbs.show_msg()
    - bbs.show_msg_header()
    Re-worked the JS bbs.netmail() implementation
    sbbs::show_msg(), show_msghdr(), msgtotxt() now take an smb_t* argument
    (don't use the pseudo-global 'smb' in these functions any longer)
    sbbs_t::putmsg() and JS console.putmsg() now accept an optional orig_columns
    argument to specify the original column width of a text for intelligent
    re-word-wrapping (e.g. as taken from a message header field). Previously, the
    original-column value was hard-coded to 80 columns (technically, 79).
    sbbs_t::show_msghdr() no longer sends a CRLF if the cursor is already at the
    top-of-screen (TOS).
    sbbs_t::show_msg() now uses the stored "columns" msg header fields to pass to
    putmsg() to intelligently re-word-wrap message bodies for display.
    sbbs_t::show_msg() and msgtotxt() return bool now instead of void.
    JS MsgBase.get_all_msg_headers() now supports an optional "expand_fields"
    argument (defaults to true). I contemplated just getting rid of the (few)
    expanding header fields (more like default-value-header fields, like 'id'), but
    decided against it, at least for now.
    JS MsgBase.put_msg_header(), the "number_or_offset" argument is optional and
    not needed if a header object argument is provided. Make this clear in this JS
    docs for this method
    I sat on this commit for a while because I noticed occasional errors like this:
        Node 1 <Digital Man> !ERROR 2 (No such file or directory) (WinError 0) in
        readmsgs.cpp line 217 (sbbs_t::loadposts) locking
        "path/to/sub" access=-100 info=smb_locksmbhdr msgbase not open
    started cropping up after introducing these changes and which I never
    root-caused. But after a clean-build and waiting a week, I haven't seen it
    again, so hopefully it was just a incomplete rebuild issue and not a new bug.