Skip to content
Snippets Groups Projects
  1. Feb 15, 2021
  2. Dec 25, 2020
    • Rob Swindell's avatar
      Add/use new FTN "BBSID" control paragraph (kludge line) · bce719a8
      Rob Swindell authored
      Advertise the system's QWK-ID (a.k.a. BBS ID) in exported echomail messages. This will allow correlation of avatars that were imported via SYNCDATA carried via QWKnet (e.g. DOVE-Net) with messages imported from those same BBSes via FTN.
      
      The alternative was to have SYNCDATA Avatar messages include all the AKAs of each BBS (in the body text), but that was looking like a rather complicated solution. This approach (the BBSID kludge) seems a much simpler solution.
      
      I still need to implement the JS side of this solution however (for avatar lookups using the FTN BBSID), but this was the first important step.
      bce719a8
  3. Nov 22, 2020
  4. Nov 19, 2020
    • Deucе's avatar
      Add support for documenting class properties to jsdocs. · 0958869d
      Deucе authored
      Then, add JSDOC support to crypto class constant objects.
      
      Also, since crypto stuff is almost half of all the docs, move all
      the crypto classes and objects to the end. It would be nice if these
      massive lists were hidden by default line the menu tree at the start.
      0958869d
  5. Aug 16, 2020
  6. May 07, 2020
  7. Apr 24, 2020
    • rswindell's avatar
      The RECIPIENTLIST header field would get removed (converted to an RFC822TO · 2b55a49f
      rswindell authored
      header field) when saving a message using the MsgBase class.
      A similar problem existed with REPLYTOLIST/RFC822REPLYTO, but was not actually
      observed.
      Since the following header fields were not populated in the msg header
      "field_list", if they existed in a message header that was modified using
      the MsgBase class, they would be lost:
      - RFC822TO
      - RFC822CC
      - RFC822ORG
      - RFC822REPLYTO
      - RFC822SUBJECT
      2b55a49f
  8. Apr 15, 2020
  9. Apr 06, 2020
    • rswindell's avatar
      MsgBase.open() would not, could not, actually create a message base. · 5da26eca
      rswindell authored
      It would create 3 0-byte files (*.shd, *.sdt, *.sid), but more is actually
      needed for a message base to be "created" (i.e. a call to smb_create()).
      So, MsgBase.open() now uses smb_open_sub() rather than smb_open() to initialize
      theSMB  status fields with the proper default values (based on the sysop
      configuration) and calls smb_crate() if the header file is empty.
      Yes, normally, SCFG creates message bases, but it shouldn't have to
      (e.g. a fresh install on *nix, doesn't actually start with any files in
      data/subs) and now that we have JavaScript-based message lister/readers, we
      really needed this support.
      5da26eca
  10. Apr 04, 2020
    • rswindell's avatar
      Bug: a get_mg_header() followed by a put_msg_header() would add a header field · 562f5e6d
      rswindell authored
      (SMTPREVERSEPATH a.k.a. "reverse_path") if it didn't already have one.
      That's because smb_getmsghdr() will point the msg.reverse_path convenience
      pointer to the from_net_addr if there was no explicit reverse-path (e.g. RFC822's
      "return-path" header field). This could manifest itself in *any* change to a
      message header via JS failing with an "illegal header length increase" error if
      the added header field just happen to put the total header length over the
      allocation threshold of the pre-existing msg header.
      
      Fix: only model a msg header "reverse_path" property if the header field
      actually existed (not based on the SMBLIB convenience pointer).
      When the expand_fields option is used, the old behavior remains but expanded
      headers cannot be written back to the base, so no harm there.
      
      Reported by Coz in #synchronet from failed runs of scrubmsgs.js. Thanks!
      562f5e6d
  11. Mar 19, 2020
    • rswindell's avatar
      Create MsgBase.dump_msg_header() method which will perform a low-level header · fdfbc651
      rswindell authored
      "dump" to an array of strings using the (new) smb_msghdr_str_list() SMBLIB
      function. The message header passed must've been previously returned from
      the get_msg_header() or get_all_msg_headers() method.
      
      A similar dump could be constructed from the header properties, as available in
      JS, but that would be inconsistent with other msg header dumps and likely lack
      header fields or details available from the lowest level dump method provided
      in SMBLIB.
      fdfbc651
  12. Mar 18, 2020
    • rswindell's avatar
      Fix bug in MsgBase.get_index() and get_all_msg_headers(): · 99818009
      rswindell authored
      The number of messages loaded was limited by the number of messages that were
      in the status header the last time the status header was read (i.e. when the
      msgbase was opened or when any of its status header properties were referenced).
      
      Also fixed a couple of weird/useless uses of the WHERE macro in error messages.
      99818009
  13. Mar 01, 2020
    • rswindell's avatar
      JS_GetClass() can return NULL. Don't dereference the return value without · 1b98bebf
      rswindell authored
      checking for non-NULL value.
      1b98bebf
    • rswindell's avatar
      Bug-fix: when enumerating a message header (returned from · 621d77fb
      rswindell authored
      MsgBase.get_msg_header or get_all_msg_headers), the message header object's
      private data (used internally in these C source functions) would be freed and
      NULL'd, apparenty as a form of optimization. This would cause some methods
      which can accept a msg header object as an argument (e.g.
      MsgBase.put_msg_header, bbs.show_msg/show_msg_header) to fail or behave
      in strange ways.
      
      Instead of freeing/NULLing the private data (and depending on that as an
      indication that the header has been enuemrated), just set a member variable
      indicating that the header has been enumerated (once) already.
      
      This is the bug that has been tripping me up with my message lister JS mod
      (see YouTube video). I can finally get that committed to CVS for testing now.
      :-)
      621d77fb
  14. Aug 23, 2019
  15. Aug 06, 2019
  16. Jul 24, 2019
  17. Jul 16, 2019
  18. May 04, 2019
    • rswindell's avatar
      smb_getplaintext and smb_getmsgtxt(...,GETMSGTXT_PLAIN) will now fall-back · 284b31b3
      rswindell authored
      to a text/html part of a multi-part MIME encoded message if no text/plain part
      exists.
      Changed smbmsg_t.charset to smbmsg_t.text_charset.
      Added smbmsg_t.text_subtype (e.g. "plain" or "html").
      Fixed issue with parsing parsed plain-text when the charset was the last
      element of the MIME-part header.
      MIMEDecodedPlainTextFmt text.dat line now includes the text sub-type arg
      284b31b3
    • rswindell's avatar
    • 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
  19. May 03, 2019
  20. May 02, 2019
    • rswindell's avatar
      get_all_msg_headers(): · 26bc4b6a
      rswindell authored
      Copy the upvotes, downvotes, and total_votes to the smbmsg_t, replicating
      what is done in sbbs_t::scanposts() - these are used by sbbs_t::show_msghdr()
      so we need to copy them if we're going to be replicating that functionality
      (showing up/down votes and score) in message headers shown with bbs.show_msg()
      and bbs.show_msg_header().
      26bc4b6a
  21. Apr 30, 2019
  22. Apr 29, 2019
    • rswindell's avatar
      Includes SMTP "Received" header fields in field_list array. · 25bb4f49
      rswindell authored
      Refer to the dubious get_msg_body() feature of dot-stuffing as that
      ("dot-stuffing") and not "rfc822-encoding" - because it isn't.
      dot-stuffing is a requirment of SMTP (RFC*821) and NNTP, not RFC822 (oops).
      25bb4f49
    • rswindell's avatar
      Add support for new message header fields: · b53ffc8a
      rswindell authored
      - to_list (RFC822TO, previosuly unavailable via JS)
      - cc_list
      - replyto_list (RFC822REPLYTO, previously unavailable via JS)
      
      Added RFC822FROM to the "field_list" array (previously unavailable via JS).
      Removed SMB_CARBONCOPY from the "field_list" (now duplicated in cc_list).
      b53ffc8a
  23. Apr 11, 2019
  24. Apr 09, 2019
  25. Apr 06, 2019
    • rswindell's avatar
      MsgBase.put_msg_header() now updates the internal (smbmsg_t) representation · 53c677c3
      rswindell authored
      of the message header so that functions that need it (e.g. bbs.show_msg_header)
      don't use/show stale data. This change requires the updated smb_copymsgmem()
      which clear/sets message convenience pointers upon copying hfields from one
      message header to another.
      53c677c3
    • rswindell's avatar
      New MsgBase method: get_index() - returns an array of all message index records · 75417a26
      rswindell authored
      (objects, in the same format as returned by the get_mgs_index() method)
      much faster than iterating through a loop, calling the get_msg_index() method
      for each message. If you want to load messages (e.g. headers, text), filtering
      by criteria found in the message index (attributes, to/from user, subject CRC)
      loading a list of indexes and filtering before calling get_msg_header() for the
      selected messages is much faster than previously available MsgBase object
      methods (e.g. get_all_msg_headers()). If you don't need to filter the loaded
      messages (you really want *all* message headers), then get_index() is of no
      benefit to you, the script-writer. This is most useful for the "mail" msgbase
      where selective loading of messages is more common.
      75417a26
  26. Apr 01, 2019
  27. 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
  28. Mar 16, 2019
  29. Mar 13, 2019
  30. 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
  31. Feb 19, 2019
    • rswindell's avatar
      Fix long-standing bug in js_ParseMsgHeaderObject which is only (currently) · 121e87b7
      rswindell authored
      used by js_post_msg() (the JS bbs.post_msg() method when used with the
      reply_header object argument) - the private data attached to a message
      header object is of type privatemsg_t, not private_t. This caused the
      dereferences of and assignments to p->smb_result in parse_header_object()
      to corrupt the privatemsg_t->msg memory causing heap corruption (caught
      on Windows debug builds in js_get_msg_header_finalize()) and stack faults
      (caught on Linux-gcc in parse_recipient_object()). This one was hard to
      find. <whew!>
      121e87b7
Loading