Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

  1. 04 Aug, 2019 2 commits
    • rswindell's avatar
      More UTF-8 fun: · 3313a87e
      rswindell authored
      - bstrlen() moved to sbbs_t, accepts an option pmode argument so it can account
        for UTF-8 encoded strings correctly
      - JS console.strlen() now accepts an optional pmode argument (e.g. P_UTF8)
      - Renamed sbbs_t::utf8_to_cp437 to sbbs_t::print_utf8_as_cp437
      - Create/use msghdr_hfield() to perform UTF-8->CP437 conversions as needed for
        printing/copying UTF-8 encoded message header fields.
      - Defined XTRN_UTF8 misc setting flag. If a message editor does *not* have this
        flag, it is assumed to *not* support UTF-8. Will likely use this for UTF-8
        doors as some point too (none known to exist, yet).
      3313a87e
    • deuce's avatar
      Add a domain argument to open_socket() so that it's possible to add IPv6 · ffa18e1f
      deuce authored
      support to the JS API.
      ffa18e1f
  2. 03 Aug, 2019 1 commit
  3. 02 Aug, 2019 2 commits
    • rswindell's avatar
      There appears to be an issue with QWKnet messages being crossed-up where · b81a0c95
      rswindell authored
      a message is posted to a different conference than the original sub-board with
      completely different header information. I suspect this has something to do
      HEADERS.DAT creation or import - not sure. So I added a "Conference"
      headers.dat field for *messages* (it already existed for votes) and use that
      value to confirm that the message header at the associated offset value in the
      QWK packet has the same conference number as the section in the headers.dat
      file. This is really just a sanity check and will only catch messages that were
      mistakening cross-posted (to a different conference) - *but* it log errors and
      save the bad QWK or REP file for me to examine more closely and see what's
      going on - and the message won't be imported (just "lost", which is also bad).
      
      So added more QWK import success/error checking and logging (especially for QWK
      packets since REP importing already had a lot of stats covered).
      
      Another check would be to store the original message number in the headers.dat
      file as well and use that to confirm that the headers.dat section is the
      correct match for the QWK message at that offset. I did not implement this
      check, yet. The conference number check seems like it'll catch most of the bad
      msgs and lead me to the root-cause.
      b81a0c95
    • rswindell's avatar
      Make the auto-hangup-after-transfer feature disable-able on a per-call basis · 293b550f
      rswindell authored
      (defauls to enabled, for backward compatibility).
      Added new autohang args to bbs.send_file() and bbs.receive_file() (default:true)
      Added support for "description" argument to bbs.send_file() as well.
      293b550f
  4. 24 Jul, 2019 1 commit
    • rswindell's avatar
      More UTF-8 goodness: · 52d5659f
      rswindell authored
      - Export all FIDOCTRL (other FTN kludge lines) to the QWK HEADERS.DAT file.
        These should already be imported if they exist, but were never added during
        export, so untested/new behavior. The control paragraph (kludge line) of
        specific interest here is the "CHRS" (charset) kludge we need for UTF-8.
      
      - Don't use the QWK "newline" character (0xE3) when the message is UTF-8.
        Use bare-LF's instead. This is pretty untested at this point as I will need
        another QWKnet board to post or receive UTF-8 encoded messages to test,
        getting the code into CVS is the first step. At least for now, there's no
        opt-in/out for this behavior. If your BBS has UTF-8 encoded messages, some
        QWK nodes or offline readers may have trouble with packets which include
        those messages. Or they may work fine (but likely display garbage CP437
        chars in-place of the proper Unicode codepoint glyph).
      
      - The beginning of UTF-8 input support in getstr() - which needs more work,
        particularly around character and word deletion and insertion.
      - The internal message editor now supports UTF-8 messages and kind of somewhat
        supports inputting UTF-8 characters in message text.
      
      New put/print text flag: P_AUTO_UTF8 which can auto-detect UTF8 strings and
      do the "right thing" for the user's terminal. New associated sbbs_t method:
      auto_utf8() which automatically sets P_UTF8 for any stirng that begins with
      a UTF-8 BOM (ZWNBSP). Else, if the P_AUTO_UTF8 mode flag is set, then
      it checks to see if the string contains invalid US-ASCII chars but valid UTF-8
      sequences and then sets P_UTF8 accordingly. Used by putmsg() and bputs().
      
      There's a new permuation of bprintf() which accepts a mode argument
      (i.e. for P_UTF8) and passes it on to the new mode-capable bputs().
      52d5659f
  5. 19 Jul, 2019 1 commit
    • rswindell's avatar
      Support for a 3rd line of RESULT.ED drop file (from external message editors): · 4444e7ff
      rswindell authored
      Full editor name and version details (up to 127 chars), for use in the EDITOR
      msg header field which is propagated over QWK networks.
      From what I could find, the WWIV RESULT.ED file format only ever contained 2
      lines:
      <Anonymous: 0/1>
      <subject>
      
      So adding support for an optional 3rd line should be fine and backwards
      compatible. Hopefully WWIV or its message editors don't define a different
      "standard" 3rd line in the future. :-)
      4444e7ff
  6. 16 Jul, 2019 1 commit
    • rswindell's avatar
      Move login username/number parsing into a the C++ code (from login.js) since we · be7a590d
      rswindell authored
      need that internal for SSH and RLogin support of fast-logons.
      So, now, even if logging in via SSH or Rlogin, the sys_status SS_FASTLOGON
      flag will be set when the user specifies "!username-or-number" during logon and
      then the logon.js can use that to determine what to display (or not) to the
      user, during logon.
      
      The QWK logon support ("*username-or-number") is also handled in this new
      sbbs_t method: parse_login().
      
      This means the fast_logon_char is no longer configurable (hard-coded to '!')
      and the modopts.ini options are going to be parsed by logon.js from the [logon]
      section (not the [login] section).
      
      You still must set fast_logon=true in the [logon] section of modopts.ini to
      enable the fast-logon option for users.
      be7a590d
  7. 11 Jul, 2019 2 commits
  8. 10 Jul, 2019 4 commits
  9. 09 Jul, 2019 1 commit
    • rswindell's avatar
      petdefs.h was (silently) moved from src/sbbs3 to src/encode. · eda5afb9
      rswindell authored
      Since not *everything* that #include's sbbs.h needs the PETSCII defs,
      remove it from sbbs.h and just #include petdefs.h where we need it.
      The catch-all header file is a problematic organizational design and we are
      moving away from that.
      eda5afb9
  10. 08 Jul, 2019 3 commits
  11. 07 Jul, 2019 1 commit
  12. 06 Jul, 2019 1 commit
  13. 09 May, 2019 1 commit
    • rswindell's avatar
      Support bright background colors: · 48e7520e
      rswindell authored
      - for PETSCII, this is automatic and you don't lose blink, but you do lose
        colored foreground when enabling a bright background ("reverse video")
      - for ANSI, this mode is typically referred to as "iCE colors" and disables
        blinking-text support
      - Ctrl-AE (^AE) is the new attribute code to enable bright-background
        (will have no effect on ANSI terminals that are not iCE color enabled)
        "E" is now valid in the ctrl/attr.cfg file and string values for JS
        console.attributes assignments, as well
      - Ctrl-AI (^AI) - blink - now does nothing for ANSI/ICE color terminals
        (blinking is not supported in combination with bright-background)
      - Using a new/non-standard CGA attribute bit-flag to indicate the selection of
        bright-background colors (BG_BRIGHT, bit 10), separate from BLINK.
        This change required all/most char/uchar attribute representations to be
        converted to int/uint.
      
      New text.dat strings:
      - PetTerminalDetected (renamed from PetTermDetected)
      - PetTerminalQ
      - TerminalAutoDetect
      - TerminalColumns
      - TerminalRows
      - TerminalMonochrome
      - TerminalColor
      - TerminalIceColor
      - IceColorTerminalQ
      This also moved the MsgCarbonCopyList definition to the end of the file
      for now.
      
      PETSCII reverse-video attribute fix:
      When a CR is sent to the terminal, the reverse-video attibute is auto-disabled
      so update our "current attribute" (curatr) value to match the remote.
      
      Support new printfile/putmsg mode flag: P_WRAP to force an ungraceful
      line-wrap (splitting) to the specified column width. If no column width is
      specified (0), then this mode will force an ungraceful wrap before the last
      terminal column where some terminals *may* auto-wrap.
      
      JS console.printfile() and printtail() methods now support an optional
      "orig_columns" argument, similar to console.putmsg(). Must specify P_WORDWRAP
      or P_WRAP for this argument to have any effect.
      
      Much improved terminal-type selection/configuration in the user defaults
      menu and abort (^C) at any of the yes/no prompts is now detected/handled much
      better (to answers to the prompted questions are not saved to the user
      settings).
      48e7520e
  14. 04 May, 2019 3 commits
    • rswindell's avatar
    • rswindell's avatar
      Add an optional mode (K_* flag) argument to sbbs_t::getkeys() and by extension, · 578f7af1
      rswindell authored
      JS's console.getkeys(). If no mode value is specified, K_UPPER is the default
      behavior (same as before). *.getkeys() currently only recognizes the following
      mode flags:
      - K_UPPER
      - K_NOECHO
      - K_NOCRLF
      
      K_NONE (0) is also a valid value.
      578f7af1
    • 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
  15. 02 May, 2019 2 commits
    • 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
  16. 12 Apr, 2019 1 commit
    • rswindell's avatar
      Define and use a new external message editor option: SAVECOLUMNS · ee00b5f8
      rswindell authored
      (default: off) - when enabled, the current terminal width (columns) will be
      saved in the msg header.
      When using the internal msg editor or raw intput mode, the columns are always
      saved in the message editor. fseditor.js should have this option enabled.
      ee00b5f8
  17. 11 Apr, 2019 1 commit
    • rswindell's avatar
      Define and use sbbs_t::msghdr_tos (exposed via JS as · 0ad2c4a2
      rswindell authored
      console.msghdr_top_of_screen):
      a hack to let scripts know whether the most-recently displayed message header
      was displayed on the top of the terminal screen (or not). This allows us to
      show avatars at the top of the screen when the header is up there, rather than
      relevative to the bottom of the header (the pos can vary, depending on stuff).
      0ad2c4a2
  18. 10 Apr, 2019 2 commits
  19. 09 Apr, 2019 1 commit
  20. 26 Mar, 2019 1 commit
  21. 24 Mar, 2019 1 commit
    • 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
  22. 22 Mar, 2019 1 commit
    • rswindell's avatar
      Use default calling convention (__cdecl) for DLL funcs in Borland builds. · bf82a889
      rswindell authored
      Fix age-old bug with Borland/C++Builder built executables (Windows):
      to achieve compatibility with  the default __cdecl symbol naming rules of
      Visual C++, we were using __stdcall convention for DLL functions when
      building code with Borland/C++Builder tools and using the default (__cdecl)
      convention when building with Microsoft (Visual C++) tools. Although this
      allowed symbols to be located when linking, the calling convention mismatch
      caused a stack cleanup issue that very rarely manifested itself in a bug
      (e.g. exception of some kind in sbbsctrl.exe, usually). Mismatching
      the calling conventions was unintentional (I thought the default for MSVC
      DLL functions was __stdcall) - but since the calls to MSVC-Built DLL functions
      worked 99% of the time, I didn't realize there was an underlying issue. So I
      now work-around the DLL symbol naming mismatch using a command-line option (-a)
      passed to implib in src/sbbs3/ctrl/makelibs.bat
      
      I had previously worked-around exceptions when calling MSVC DLL functions in
      sbbsctrl.exe by calling the problematic DLL functions from a timer tick handler
      rather than a user control (e.g. button) event handler. Those work-arounds can
      now be removed.
      
      The erroneous "DLLCALL" definition design pattern was replicated (copy/pasted)
      to many other projects' header files in cvs.synchro.net. In the future, we may
      want to just remove all instances of *CALL since they now serve no purpose and
      appear as useless "Kruft" (but do allow us to more-easily globally change DLL
      function calling conventions if/when necessary in the future).
      bf82a889
  23. 20 Feb, 2019 1 commit
    • 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
  24. 19 Feb, 2019 1 commit
    • rswindell's avatar
      sbbs_t::postmsg() and JS's bbs.post_msg() changes: · d95d30ea
      rswindell authored
      When the WM_QUOTE mode flag is set and the 'remsg' is specified, the original
      message will quoted (excluding message tails, using the proper word-wrapping).
      If the quote file already exists before calling postmsg()/bbs.post_msg(), it
      will be over-written. This allows JS script to initiate reply-posts with quoted
      text without having to create their own quotes file. It also means there's no
      need to call sbbs_t::quotemsg() before calling sbbs_t::postmsg().
      sbbs_t::quotemsg() now takes an smb_t* arg (stop using the sbbs_t 'global'
      smb) and now returns bool.
      d95d30ea
  25. 17 Feb, 2019 1 commit
    • rswindell's avatar
      QWK-reply-posted email/netmail messages did not contain a Message-ID. Really? · 7446c395
      rswindell authored
      So I created a single add_msg_ids() function (mostly migrated from postmsg.cpp)
      to make this incredibly easy so any/everywhere that adds a message to a message
      base should be able to call it. This function also creates reply-IDs (when
      relevant) and program ID (Fido-PID) header fields:
      - FIDOPID (always)
      - FIDOMSGID (if an echomail post)
      - FIDOREPLYID (if an echomail reply-post)
      - RFC822MSGID (always)
      - RFC822REPLYID (if a reply)
      7446c395
  26. 08 Feb, 2019 1 commit
    • rswindell's avatar
      Add/use new function findstr_list() which opens and returns a string list · 32051b32
      rswindell authored
      suitable for passing to findstr_in_list().
      SBBSecho peformance improvement: don't open/read the twitlist.cfg file for
      *each* imported message: just read it once during initialization (using the new
      findstr_list() function of course).
      Reversed course on the findstr()/trashcan() matching logic: significant leading
      white-space was not backwards compatible (and was the cause of recent lost
      messages in DOVE-Net) - so I decided to go a different route and support
      C-style character escape sequences (e.g. \r, \n, \t, \x##, etc.) in findstr
      comparison strings, so the new way to represent a leading space character
      in a filter file (e.g. twitlist.cfg, name.can) would be: "\ ". So to match (e.g.
      filter/disallow) all strings with a leading space: "\ *". "\x20 *" would also
      work (0x20 is ASCII for "space").
      Now, again, leading white-space in filter files (e.g. text/*.can, twitlist.cfg)
      is ignored. <sigh>
      32051b32
  27. 03 Feb, 2019 1 commit
  28. 20 Jan, 2019 1 commit
    • rswindell's avatar
      The "stdio" File objects (stdin, stdout, stderr) did not work on Windows, · 7acadb70
      rswindell authored
      because the stdout FILE* is a different address in jsexec than it is in sbbs.dll
      (where the actual File I/O operations occurred). Refactored by passing the
      stdio file descriptor (and open mode) to js_CreateFileObject rather than the
      FILE* and using fdopen() to get a FILE* associated with the descriptor.
      stdout.write() now works, for example.
      7acadb70