Skip to content
Snippets Groups Projects
  1. Jul 16, 2019
  2. May 04, 2019
    • rswindell's avatar
      Resolved GCC error: 'js_bbs_class' was declared 'extern' and later 'static' · efb81b98
      rswindell authored
      MSVC had no problem with this. <sigh>
      efb81b98
    • rswindell's avatar
      Define and use a wrapper for JS_GetInstancePrivate(): js_GetClassPrivate() · 6f83c4ff
      rswindell authored
      Use this in place of JS_GetPrivate() in native class methods that need the
      class instance's private data pointer and will do bad things if that pointer
      points to something other than what is expected. mcmlxxix (matt) discovered
      that using Object.apply(), you can invoke class methods where the 'this'
      instance is a different class. This would result in
      "Internal Error: No Private Data." or a crash.
      So now, gracefully detect this condition and report a meaningful error:
      "'<class-name>' instance: No Private Data or Class Mismatch"
      
      Also, important to note: if the method uses JS_THIS_OBJECT to get the JSObject*
      to pass to JS_Get*Private, then it must do this *before* it calls JS_SET_RVAL.
      
      From jsapi.h:
       * NB: there is an anti-dependency between JS_CALLEE and JS_SET_RVAL: native
       * methods that may inspect their callee must defer setting their return value
       * until after any such possible inspection. Otherwise the return value will be
       * inspected instead of the callee function object.
      
      The js_crypt*.c files still need this treatment.
      6f83c4ff
  3. May 02, 2019
    • rswindell's avatar
      @-code changes: · 0868c5d9
      rswindell authored
      Expanded codes will not *not* go beyond the terminal column width (minus 1).
      If you need the old/wrap behavior, add a "-W" modifier to your @-code.
      If a length value is specified with -W, it is ignored.
      
      - MSG_TO, MSG_FROM, MSG_SUBJECT now reflect the header values passed
        to sbbs_t::show_msghdr(), JS bbs.show_msg_header() and not necessarily the
        actual stored (e.g. MIME-encoded) header values.
      
      New codes:
      - MSG_CC - reflect a message's CC list, if it has one
      - DATETIMEZONE - combines DATETIME and TIMEZONE in one string
      0868c5d9
    • rswindell's avatar
      Support the passing of optional 'subject', 'from', and 'to' values to · 4fc5b9a5
      rswindell authored
      show_msghdr(), over-riding the values from the passed smbmsg_t. This is useful
      for, say, displaying MIME-decoded values rather than the MIME-encoded versions
      of the header fields that you often find in email today.
      4fc5b9a5
  4. Apr 11, 2019
  5. Apr 10, 2019
  6. Mar 24, 2019
    • 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
      
      Note:
      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.
      b4d31140
  7. Feb 20, 2019
    • rswindell's avatar
      Reversed course on the WM_QUOTE mode handling in sbbs_t::postmsg() · 57424543
      rswindell authored
      (JS bbs.post_msg()): If the WM_QUOTE mode flag is *not* set, then it will auto-
      create the quote file (quotes.txt) and add the WM_QUOTE mode bit before calling
      sbbs_t::writemsg(). So if existing JS scripts call bbs.post_msg(..., WM_QUOTE)
      with a custom-created quote file (e.g. with msg tails), that'll still work as
      before (e.g. DDMsgReader.js).
      
      bbs.email() and bbs.netmail() now support an optional reply_header_object
      argument which works like bbs.post_msg(). These methods (and the underlying
      C++ methods: sbbs_t::email(), netmail(), inetmail(), all auto-create the
      quote file now, when the WM_QUOTE mode flag is *not* set.
      
      The auto-created quotes.txt now includes the plain-text version of MIME-encoded
      messages.
      
      the bbs.post_msg(), email(), and netmail() methods now all support reply
      header objects that came directly from bbs.get_msg_header() *or* copies of
      such header objects (but the auto-quoting feature won't work when supplied
      this type of header object). So if passed a header object returned from
      bbs.get_msg_header(), we can now use the message base (for auto-quoting) and
      the underlying msg storage directly (no JS parsing necessary). This is what
      the new js_GetMsgHeaderObjectPrivates() function is used for.
      
      js_ParseMsgHeaderObject() (and the underlying parse_header_object() function)
      now supports either an actual internally-generated msg header object (e.g.
      returned from bbs.get_msg_header()) or one that is a copy or hand-constructed.
      
      quotemsg() no longer tries to get a copy of the msg index/header. It shouldn't
      have to since we can now get to underlying msg storage in the js_msgbase.c
      via js_GetMsgHeaderObjectPrivates().
      
      quotemsg() now reads only the plain-text portion of MIME-encoded messages.
      
      As part of this effort, I modernized the method prototypes using default
      argument values (e.g. WM_NONE for wm_mode arguments) and removed some
      extraneous WM_EMAIL and WM_NETMAIL specifications (these wm_mode flags are
      automatically added by the sbbs_t::email() and *netmail() functions).
      
      savemsg() now *does* support reply-IDs/thread-linkage via the additional
      'remsg' argument (when non-NULL).
      
      Replaced some use of nulstr with NULL.
      
      Replaced more boilerplate SMB open code with calls to smb_open_sub().
      57424543
  8. Feb 19, 2019
  9. Jan 07, 2019
  10. Oct 26, 2018
  11. Oct 22, 2018
    • rswindell's avatar
      The big PETSCII commit: · 31303187
      rswindell authored
      So Omegix recently asked in the Synchronet Discussion group whether or not
      a PETSCII (Commodore) terminal could be used to access his Synchronet BBS.
      Now, the answer is "Yes". :-)
      The major issues addressed:
      
      - detecting a PETSCII terminal, solved by assigning specific (configurable):
        TCP ports to be used for incoming PETSCII connections, by default:
        port 64 is for 40-column PETSCII and port 128 is for 80-column PETSCII,
        but if the terminal sends a Telnet Window Size reply (e.g. SyncTERM), then
        either size terminal should fine on either port.
        The port numbers are configurable in the [BBS] section of your sbbs.ini
        file using the new keys: PET40Port (default value: 64) and PET80Port
        (default value: 128). Having these keys set doesn't make make the terminal
        server listen on that additional port - you'll need to add more
        IP:port combinations to one of Interfaces values, example:
          TelnetInterface=71.95.196.34,71.95.196.34:64,71.95.196.34:128
        And you don't have to use Telnet for the PETSCII connections - you could use
        RLogin or SSH instead (or in addition).
      
      - support for terminal widths < 80 columns:
        This was achieved through a combination of text.dat changes (numerous),
        new Ctrl-A and @-codes and new optional terminal-width-specific menu files
        (e.g. text/menu/main.40col.asc)
        A side effect of these changes is actually better support for terminals
        *wider* than 80 columns as well!
      
      - support for terminals that don't expand tabs to spaces (e.g. PETSCII):
        The terminal server now handles tab expansion with a run-time settable
        tab-size (default size: 8)
      
      - conditional access based on PETSCII (or small) terminal use (or not):
        + New PETSCII ARS keyword (boolean)
        + New COLS and ROWS ARS keywords (for terminal width and height requirements)
        + New TERM (string) ARS keyword
      
      New @-codes:
        - WORDWRAP, when placed at the top of a file, enables auto-wordwrap for
                    lines longer than the terminal width
        - CENTER, the text following before an end of line will be displayed centered
                  on the terminal (whatever the width, in columns)
        - CLEAR, like CLS, except it ignores (doesn't display) a CRLF that follows
        - COLS, current number of terminal columns (width)
        - ROWS, current number of terminal rows (height)
        - TERM, the auto-detected or reported terminal type (e.g. ANSI, TTY, etc.)
        - SYSONLY, toggles "echo" (display) off/back-on for non-sysops
                  similar to the Ctrl-A( and ) codes, but more convenient to use
                  (and PabloDraw won't strip the @-code from the file like it does
                   with Ctrl-A codes it doesn't support)
      
      New Ctrl-A codes:
        - \ conditional new-line/continuation when the terminal width is < 80 cols
            prints the new text.dat string LongLineContinuationPrefix
      
      yesno() will now return true if passed a blank string.
      noyes() will now return false if passed a blank string.
      getstr()'s input length limiting based on terminal width is more broadly
                 applied now (not just when using the K_LINE mode flag).
      
      New JS bbs object method: menu_exists(<base_filename>) returns Boolean
      New JS console object property: tabstop (Number)
      New JS console object methods: getbyte() and putbyte() to recv/send raw byte
          value with (very little) interpretation/intervention by the terminal server
      New JS console object method: creturn() - performs a carriage return
          (or equivalent)
      New JS (and C) printfile() mode flag: P_TRUNCATE, causes long lines to be
          truncated, rather than displaying causing a line-wrap.
      
      New text.dat strings:
        - NoAccessTerminal (for ARS check failures)
        - LongLineContinuationPrefix (for breaking long lines for 40col terminals)
        - Scanning (replaces a previously hard-coded "Scanning" string)
        - Done (replaces a previusly hard-coded "Done")
        - Scanned  (when finished scannning, clears the progress bar)
      31303187
  12. Oct 09, 2018
  13. Jul 27, 2018
    • rswindell's avatar
      Fixed a couple of issues with the last commit. · af0e4f99
      rswindell authored
      Make similar enhancements to the bbs.put_node_message() method:
      - if you message text is given, it is prompted for
      - if no node number is given, it is prompted for
      - if a node number value of -1 is specified, send message to all nodes
      - logs the activity
      af0e4f99
    • rswindell's avatar
      bbs.put_telegram() enhancements (mostly copy/pasted from chat.cpp): · e628b3cc
      rswindell authored
      - now creates a log entry that the user sent a telegram to somebody
      - if a destination user number is not specified, one is prompted for
      - the destination user number is compared against the current user's
        restrictions (e.g. F-restricted users can't telegram the sysop)
      - if a telegram message text is not specified, one is prompted for
      
      unrelated fix to bbs.list_msgs(): if a 'find' argument was passed, too many
      increments of argn in call to macro: JSVALUE_TO_MSTRING
      e628b3cc
    • rswindell's avatar
      Fix copy/paste errors in previous commit. · 0a9e0375
      rswindell authored
      0a9e0375
    • rswindell's avatar
      New JS 'bbs' properties: · cb2a8f01
      rswindell authored
      node_status - reflects the current node's 'status' value (see nodedefs.js)
      node_errors - current node's error counter
      node_useron - current node's logged-in user number (if applicable, else 0)
      node_connection - current node's connection rate or protocol
      node_misc - see nodedefs.js
      node_aux - see nodedefs.js
      node_extaux - see nodedefs.js
      
      This are read-only wrappers around the sbbs_t::thisnode property and have
      the same fundamental meaning as the properties of the same names in the
      system.node_list[] array.
      
      bbs.node_action is a little different as it is the authorative action value
      that should be sync'd with the node database (node.dab) and not necessarily
      the current value in the node database - it's also writeable.
      cb2a8f01
    • rswindell's avatar
    • rswindell's avatar
      Created 2 new bbs methods: select_node() and select_user(). · 7f97bb09
      rswindell authored
      These are wrappers for the C++ function: sbbs::getnodetopage() and will
      be used by the privatemsg.js (Ctrl-P handler) and possibly other node/user
      interaction stuff in the future.
      7f97bb09
  14. Jun 10, 2018
    • rswindell's avatar
      JS bbs object changes: · a32a52cb
      rswindell authored
      - finduser() method no longer prints "Unknown user" upon failure (the calling
        script can do this if/when it wants).
      - read_mail() method now accepts an optional 3rd argumnet (loadmail_mode)
        which may be used to load *only* un-read mail (for example), see LM_* in
        sbbsdefs.js
      
      Pass the lm_mode as a 4th argument to any readmail mod (if one is installed) -
      this correlates with the LM_* mode flag values (0 is normal/usual).
      
      File attachments can also be in a file/####.out directory (e.g. outbound
      Internet email attachments), so try deleting from there too when deleting
      mail with attachments.
      a32a52cb
  15. Mar 10, 2018
  16. Feb 23, 2018
  17. Feb 20, 2018
  18. Jan 12, 2018
    • rswindell's avatar
      New @-codes (for currently viewed file): · 464f80c5
      rswindell authored
      - FILE_AREA
      - FILE_AREA_DESC
      - FILE_LIB
      - FILE_LIB_DESC
      - FILE_LIB_NUM
      - FILE_DIR
      - FILE_DIR_DESC
      - FILE_DIR_CODE
      - FILE_DIR_NUM
      - FILE_NAME
      - FILE_DESC
      - FILE_UPLOADER
      - FILE_SIZE
      - FILE_CREDITS
      - FILE_TIME
      - FILE_TIME_ULED
      - FILE_TIME_DLED
      - FILE_DATE
      - FILE_DATE_ULED
      - FILE_DAT_DLED
      - FILE_TIMES_DLED
      Fixed MSG_ATTR @-code (missing SPAM attribute)
      New text.dat line: FileHdrDescSeparator, displayed between file detail display
      (name, date, uploader, etc.) and extended description, if there is one. This
      is used to execute showfileavatar.js.
      New JS 'bbs' object properties:
      - file_name
      - file_description
      - file_dir_number
      - file_attr
      - file_date
      - file_credits
      - file_uploader
      - file_update_date
      - file_download_date
      - file_download_count
      Inspiried by Lon Seidman's now infamous (but likely common) Synchronet sysop
      blunder (removing a file rather than downloading it while demonstrating his BBS
      on his youtube channel:
      - New text.dat line: RemoveFileQ <- using this rather than the vague:
        AreYouSureQ, when prompting to remove a file
      - The sysop command to remove files from the batch file flagging prompt has
        been changed from 'D' (delete) to 'R' (remove).
      - The 'D' command from the batch file flagging prompt may now be used for
        immediate Download of any flagged file(s).
      - When flagging files with '*', treat the same as '*.*'
      464f80c5
  19. Jan 07, 2018
  20. Aug 09, 2017
  21. Jan 10, 2016
  22. Nov 08, 2015
    • deuce's avatar
      Give bbs and console objects their own personal copy of the sbbs_t so they · b69bf653
      deuce authored
      can be used from background threads.
      
      If the parent thread has a bbs and/or console object, create the object in
      the children as well.
      
      Accessing the console object from more than one thread is very much a bad thing.
      Accessing the BBS object from more than one thread may be bad as well...
      b69bf653
  23. Aug 22, 2015
  24. Aug 17, 2015
  25. Apr 29, 2015
  26. Mar 07, 2014
    • rswindell's avatar
      * Eliminated the sbbs.ini [BBS] Options flag: USE_2ND_RLOGIN · b45af31d
      rswindell authored
      - this option has been a default option flag for 10 years
      - this option was introduced *before* the RLogin password capability
      - Synchronet now always expects the login-ID (alias) to be the 2nd string
      received during RLogin connections (called 'server-user-name' in RFC 1282.
      * Now storing the complete terminal type/speed string received during RLogin
      connection in the bbs.rlogin_terminal property (sbbs_t.rlogin_term in C++).
      * bbs.rlogin_gate() is over-hauled:
      - arguments are: address, client-user-name, server-user-name, terminal, mode
      - if existing JS module assumes this to be: address, server-user-name, password
        those scripts will need to be updated to reflect the correct argument order
      - all arguments beyond the first are now optional
      - the terminal string can now be passed-in
      * Deprecated the telnet gateway option: TG_SENDPASS (the 'password' if desired
      to be sent as the 'client-user-name' can be specified as an argument and this
      option sent the password as the *second* RLogin string ('server-user-name'),
      which was always wrong.
      * sbbs_t::telnet() can now accept the terminal string as an optional argument.
      b45af31d
  27. Mar 06, 2014
Loading