Skip to content
Snippets Groups Projects
  1. Jan 14, 2025
  2. Jan 11, 2025
  3. Dec 21, 2024
    • Rob Swindell's avatar
      Encode local wallclock (not time_t) in SMB's when_t.time · 445394f9
      Rob Swindell authored
      Increment SMBLIB version to 3.10
      
      Fix issue #845: Changing system/OS time zone, changes dates/times of posted
      messages
      
      Sysops and users shouldn't notice any change unless they change the time zone
      of their system/OS (not accounting changes for daylight/standard time) and
      the result will be that message dates appear the same after such a change.
      
      For backward compatibily, any stored time_t's in msghdr_t.when_written.time
      (i.e. all existing SMB messages) will still be decoded and displayed properly.
      We detect a time_t value by the upper 6 bits being non-zero. When the upper
      6 bits of a when_written.time value are zero, then we know the 'year' is
      stored in the 16-bits before the when_written field (never used bits of the
      netattr field, now part of the when_t structure definition) and the Month,
      Day, Hour, Minute, and Second of the wallclock at the poster's site are
      encoded in the low 26 bits of the time field.
      
      This also eliminates more uses of 32-bit time_t that'll likely start being
      a problem 2038 and really fall over and die in 2106. At least messages'
      posting dates won't have any issue now. The "when_imported" values could use
      a similar treatment someday I suppose - and we could get rid of the
      when_imported.zone value as its not really needed we could use those 16-bits
      for the when_imported.year.
      
      Didn't change anything with filebases (still using time_t's though the
      when_written hdr field isn't used for much with regards to files).
      
      Yes, we could have converted all imported "broken down" message dates to
      UTC and continued to store them as a time_t using timegm() instead of mktime()
      for conversion to time_t, and I considered that. But we would have needed to
      create/use a flag in the message header to indicate such stored date/times
      (since they'd have to go through different adjustment for original time zone
      before display, basically reversing the logic of all the places we display the
      message dates/times using localtime verus gmtime/UTC C RTL functions),
      couldn't just initialize the time with a call to time() upon import of local
      messages (unless the local timezone happened to be UTC). And in the end, we'd
      still have a 32-bit time_t value. So this seemed the better path.
      
      I would have liked to have stored the date fields in a more human readable
      encoding (BCD or decimal, ala isoDate and isoTime_t), but I just didn't have
      the spare bits in the fixed portion of message headers to be wasteful like
      that.
      
      Here's an example from smbutil v of a message header posted after this change:
        when_written     03292595 41E0 Fri Dec 20 18:22:21 2024 PST
        when_imported    6766265D 41E0 Fri Dec 20 18:22:21 2024 PST
      
      Notice the difference in the hex encoding of the date/time between the 2
      header fields: when_imported still uses time_t. The when_written.year value
      isn't output here.
      445394f9
  4. Dec 14, 2024
  5. Dec 01, 2024
    • Rob Swindell's avatar
      Simplify the getnode.cpp API - use bool returns, default paramaeter value · 62ed3d3a
      Rob Swindell authored
      getnodedat() now performs a non-locked read by default.
      
      Perform more checks of getnodedat() return value before calling putnodedat()
      to avoid unintentionally zeroing out node.dab records.
      
      Add/use unlocknodedat() method for unlocking a node.dab record without
      writing.
      
      Note: The userdat.c getnodedat() and putnodedat() still return int (i.e. 0 on
      success), so that can be confusing.
      62ed3d3a
  6. Oct 28, 2024
  7. Sep 07, 2024
  8. Mar 05, 2024
  9. Feb 16, 2024
    • Rob Swindell's avatar
      UTF-8 improvements · 2584a864
      Rob Swindell authored
      Don't corrupt UTF-8 strings with SAFECOPY() (use new SAFECOPY_UTF8).
      
      Some terminals (notably, Windows Terminal) display zero width UNICODE chars
      as a single column-wide space. <sigh> Auto-detect the zero-width "width"
      (1 or 0) of the terminal during connection and UTF-8 auto-detection.
      
      getstr() works a lot better now with UTF-8 strings with wide chars (e.g.
      emojis), but likely much more to do.
      2584a864
  10. Nov 22, 2023
  11. Mar 04, 2023
  12. Feb 27, 2023
    • Rob Swindell's avatar
      Add optional/configurable feedback module · b0a85a1e
      Rob Swindell authored
      Most sysops didn't know it, but if exec/feedback.* existed, it would be
      executed just before any user sent an email to the sysop (user #1),
      excluding new user validation requests:
      - make this module name configurable and loadable from mods
      - support JS module here (exit(1) to abort the feedback)
      - invoke for email being sent to *any* sysop (not just user #1)
      - don't invoke the module when sending *from* a sysop account
      
      This fixes issue #16
      b0a85a1e
  13. Feb 19, 2023
    • Rob Swindell's avatar
      The great 'long int' purge of 2023 part 1 · 59d8974c
      Rob Swindell authored
      At one time, Synchronet was a 16-bit DOS project, plagued by the 16-bit [u]int, so long's were used everywhere > 16-bits were known to be needed/wanted (This is before the days of the standard sized types from stdint.h), and they've persisted.
      
      But '[u]long int' is 64-bits on *nix 64-bit builds, 32-bits everywhere else (even 64-bit Windows builds if/when we ever get around to that), so this could lead to insidious bugs that would only show up on one flavor or the other. Since [u]int is 32-bits on everything we currently support, we'll use that instead of [u]long.
      
      This "part 1" because I'm sure there's going to be warnings and errors from the GCC/Clang builds as a result, which I'll get to next.
      59d8974c
  14. Feb 17, 2023
    • Rob Swindell's avatar
      Move sysop notification settings from node to system level · e2a01274
      Rob Swindell authored
      The validation user (required new user feedback user number) and error notification/level settings don't make sense under node settings in today's world where all nodes typically run on the same system and serve the same BBS.
      
      Moved from SCFG->Nodes->... Advanced Options to (new sub-menu) SCFG->System->Notifications. Likewise, these 3 settings (valuser, erruser, errlevel) were moved from node*/node.ini to ctrl/main.ini.
      
      If you're already running v3.20a, then you'll want to make sure you set these in SCFG->System->Notifications how you prefer them as the migration (now handled in upgrade_to_v320.js) won't have been done for you automatically. The default is no-new-user-feedback required and no-error-notification user set.
      
      Added a prompt to the SCFG setup wizard to prompt for this setting since it still is a FAQ.
      
      Other cosmetic changes to SCFG help and setup wizard.
      e2a01274
  15. Oct 18, 2022
    • Rob Swindell's avatar
      Full read/write support of new user.tab userbase file · 8a22b246
      Rob Swindell authored
      Also resolved some 32 vs 64-bit 'long' issues/ambiguities that have long-remained. :-)
      
      This commit also removes logon.lst file support.
      
      There's a TODO block remaining in js_user.c for setting portions of a user's birthdate (e.g. just the year or month or day).
      8a22b246
  16. Nov 18, 2021
    • Rob Swindell's avatar
      Add text.dat lines for "All" and the List key ('L'), used in quoting · 9513bdba
      Rob Swindell authored
      The internal line editor's quoting feature add some hard-coded strings ("Done" and "All") and the (L)ist key was hard-coded. Use the text.dat string (new and pre-existing) for these now.
      
      Also, use the new sbbs_t *_key() methods for referencing the configured key bindings (via text.dat) for these common key-stroke commands.
      Convert the text.dat strings for keys (e.g. YNQP) to uppercase always as well.
      9513bdba
  17. Sep 25, 2021
    • Rob Swindell's avatar
      Call smb_updatethread() from sbbs_t::email() to perform Keyop "magic" · 7d52f7e4
      Rob Swindell authored
      As discovered by Keyop and reported via IRC, when replying *to* a local mail box and *not* using the hard-coded email menu (e.g. when when using msglist.js), the original message's "Replied" attribute flag was not set. When replying to a netmail address (at least, Internet or FidoNet, unsure about QWKnetmail), the attribute would be set.
      
      This discrepancy was because this email() function doesn't use the  "modern" smb_addmsg() function (which also calls smb_updatethread()), but add the message body text the old/manual way and never called smb_updatethread(). smb_updatethread() does the thread linkage stuff (which is usually unnoticed in the mail base) *and* sets the "Replied" attribute of the original message, if it's not already set.
      
      This function should be overhauled to use smb_addmsg(), but this 2-line change at least addresses this issue for now. There's probably other places (e.g. importing mail replies via QWK/REP packets) where this thread-linkage and "Replied" attribute flag setting is still not happening.
      7d52f7e4
  18. Jun 06, 2021
  19. May 16, 2021
  20. Apr 04, 2021
    • Rob Swindell's avatar
      A poll() failure with EINTR does not mean a socket is closed. · 925e3b0a
      Rob Swindell authored
      This won't impact Synchronet as it has a separate signal handling
      thread, but we still need to behave properly for processes that
      don't.  I'm also saying that ENOMEM does not indicate a disconnection,
      though it may be better to pretend it was disconnected...
      925e3b0a
  21. Feb 15, 2021
  22. Sep 12, 2020
    • Rob Swindell's avatar
      Don't allow invalid netmail-forwarding addresses · 3eb83ec5
      Rob Swindell authored
      Don't prompt a new user to forward email to their netmail address if they
      provided an invalid netmail address (not supported by the system).
      
      If a sysop has an invalid netmail address setup for forwarding, don't try to
      forward email (or new user feedback) to that address.
      
      Re-ordered the new user terminal questions a little bit (ask for the backspace
      key first, to get earlier manual PETSCII detection). I'm not sure why I was
      enabling AUTOTERM along with PETSCII before. Removed that as PETSCII cannot
      be auto-detected.
      3eb83ec5
  23. Sep 07, 2020
    • Rob Swindell's avatar
      Fix observed race-condition resulting in the HOSTNAME @-code being blank. · dee21ed6
      Rob Swindell authored
      Eliminate the hack in each server where it will over-write startup host_name
      (with the configured Internet email address), if it's blank. This hack was
      subject to a race condition where the parent app (e.g. sbbsctrl.exe) would
      clear or re-initialize the host_name after the sever threads had initialized.
      Instead, just use a function which will return either the startup->host_name
      or (fallback to) scfg.inet_addr.
      dee21ed6
  24. Aug 16, 2020
  25. Apr 15, 2020
  26. Aug 02, 2019
  27. Aug 01, 2019
  28. Jul 08, 2019
  29. Apr 12, 2019
    • 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
  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 17, 2019
    • rswindell's avatar
      Eliminted unused variable (pid). · 0d77cdbf
      rswindell authored
      0d77cdbf
    • 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
  32. Oct 30, 2018
  33. Aug 03, 2018
  34. Jun 10, 2018
Loading