• src/sbbs3/getmsg.cpp js_bbs.cpp js_console.cpp js_msgbase.c putmsg.cpp readmail.cpp readmsgs.cpp sbbs.h writemsg.cpp

    From rswindell@VERT to CVS commit on Sunday, March 24, 2019 00:28:08
    src/sbbs3 getmsg.cpp 1.76 1.77 js_bbs.cpp 1.177 1.178 js_console.cpp 1.123 1.124 js_msgbase.c 1.231 1.232 putmsg.cpp 1.44 1.45 readmail.cpp 1.88 1.89 readmsgs.cpp 1.116 1.117 sbbs.h 1.506 1.507 writemsg.cpp 1.143 1.144
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv28135

    Modified Files:
    getmsg.cpp js_bbs.cpp js_console.cpp js_msgbase.c putmsg.cpp
    readmail.cpp readmsgs.cpp sbbs.h writemsg.cpp
    Log Message:
    New JS bbs methods:
    - 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.

    Synchronet Vertrauen Home of Synchronet [vert/cvs/bbs].synchro.net