• bbs.msg_number and related are read-only

    From Nightfox@VERT/DIGDIST to Digital Man on Tuesday, September 24, 2024 13:34:24
    Hi DM,

    For quite a while, when replying to a message, SlyEdit has had the ability to get the author's initials from the message the user is replying to, in order to quote the message with that message's author's initials. Normally, SlyEdit gets the current sub-board code & message number from bbs.smb_sub_code and bbs.msg_number (if > 0) or bbs.smb_curmsg. However, when using my message reader (DDMsgReader), it seems bbs.msg_number, bbs.smb_curmsg, and related are read-only, so DDMsgReader can't set them to pass along that information to a message editor (such as SlyEdit) that might want to use those. The solution I added a long time ago was for DDMsgReader to write a sort of 'drop file' with that information, and SlyEdit reads it (if it exists) when SlyEdit runs, so that SlyEdit can get author initials from the correct message.

    I feel like this drop file solution might not be the best solution for the issue, though I'm not sure of a different solution. I imagine those bbs.* propeties probably shouldn't be made settable.. Is bbs.mods intended for this sort of thing? I'm wondering if DDMsgReader could set some properties in bbs.mods for the current sub-board & message #, which SlyEdit could read (and then DDMsgReader would have to clear the bbs.mods values upon exit).

    Nightfox

    ---
    ■ Synchronet ■ Digital Distortion: digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Tuesday, September 24, 2024 22:55:07
    Re: bbs.msg_number and related are read-only
    By: Nightfox to Digital Man on Tue Sep 24 2024 01:34 pm

    Hi DM,

    For quite a while, when replying to a message, SlyEdit has had the ability to get the author's initials from the message the user is replying to, in order to quote the message with that message's author's initials. Normally, SlyEdit gets the current sub-board code & message number from bbs.smb_sub_code and bbs.msg_number (if > 0) or bbs.smb_curmsg. However, when using my message reader (DDMsgReader), it seems bbs.msg_number, bbs.smb_curmsg, and related are read-only, so DDMsgReader can't set them to pass along that information to a message editor (such as SlyEdit) that might want to use those.

    Yeah, that's expected. Those bbs properties reflect the message base open by the C++ code (e.g. sbbs_t::scanposts()). I could possibly make the the sbbs_t open message base (smb_t) writable via JS, and then those bbs properties would reflect that open base. Make a feature request at gitlab.synchro.net for me to look into that.

    The solution I added a long time ago was for DDMsgReader
    to write a sort of 'drop file' with that information, and SlyEdit reads it (if it exists) when SlyEdit runs, so that SlyEdit can get author initials from the correct message.

    If you're communicating between JS modules, a drop file does seem like the wrong solution.

    I feel like this drop file solution might not be the best solution for the issue, though I'm not sure of a different solution. I imagine those bbs.* propeties probably shouldn't be made settable.. Is bbs.mods intended for this sort of thing?

    Sure. I think you could actually create your property of bbs (e.g. bbs.dd_mods) and create/write properties in that object.

    I'm wondering if DDMsgReader could set some properties
    in bbs.mods for the current sub-board & message #, which SlyEdit could read (and then DDMsgReader would have to clear the bbs.mods values upon exit).

    That'll work, but note that SBBS isn't going to write those properties in bbs.mods, so you'd need to detect which set of properties was available. Having the sbbs_t message base writable/assignable via JS is probably a cleaner/better solution.
    --
    digital man (rob)

    Rush quote #69:
    He's a writer and a ranger, and a young boy bearing arms .. New World Man Norco, CA WX: 62.5°F, 84.0% humidity, 0 mph W wind, 0.00 inches rain/24hrs
    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net