- Jul 16, 2019
-
-
rswindell authored
error (e.g. can't convert 2147745800 to an integer), so use JS_ValueToECMAUint32() rather than JS_ValueToInt32() where we possibly need a full 32-bit value.
-
- May 04, 2019
-
-
rswindell authored
MSVC had no problem with this. <sigh>
-
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.
-
- May 02, 2019
-
-
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
-
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.
-
- Apr 11, 2019
-
-
rswindell authored
-
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).
-
- Apr 10, 2019
-
-
rswindell authored
download_file_attachments() and expose via new JS "bbs" method. Currently this only reall works for the mail base.
-
- Mar 24, 2019
-
-
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.
-
- Feb 20, 2019
-
-
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().
-
- Feb 19, 2019
-
-
rswindell authored
Renamed js_postmsg() -> js_post_msg() for good measure.
-
- Jan 07, 2019
-
-
sbbs authored
warning: ISO C++ forbids converting a string constant to 'char*' and comparision between signed/unsigned int. This does *not* address the reported build issue: In function `_start': (.text+0x20): undefined reference to `main'
-
rswindell authored
this should fix the missing/misaligned 'bbs' property descriptions in jsobjs.html
-
- Oct 26, 2018
-
-
rswindell authored
-
- Oct 22, 2018
-
-
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)
-
- Oct 09, 2018
-
-
rswindell authored
-
- Jul 27, 2018
-
-
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
-
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
-
rswindell authored
-
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.
-
rswindell authored
-
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.
-
- Jun 10, 2018
-
-
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.
-
- Mar 10, 2018
-
-
rswindell authored
conditions) - e.g. if a malloc or realloc failed, then some other allocated memory would be leaked.
-
- Feb 23, 2018
-
-
rswindell authored
we are always freeing the pointer that was asigned the text.dat list and things will crash (thanks for the report, Rastus).
-
- Feb 20, 2018
-
-
rswindell authored
unused functions).
-
rswindell authored
Luckily, it doesn't appear anyone actually uses this function.
-
rswindell authored
HANDLE_PENDING() contains a return, so it's theoretically possible that the memory allocated by the previous JSVALUE/STRING_TO_... allocation could be leaked. So now we pass an optional pointer to HANDLE_PENDING() which will call free() on it if it's not NULL, and then sets it to NULL for good measure.
-
- Jan 12, 2018
-
-
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 '*.*'
-
- Jan 07, 2018
-
-
rswindell authored
-
- Aug 09, 2017
-
-
rswindell authored
password is not prompted for, otherwise, the behavior is the same as before (the SY: prompt is displayed and the system password must be entered by the user).
-
rswindell authored
-
rswindell authored
bbs.login() now accepts 2 additional optional arguments: user_pw and sys_pw if these passwords are supplied, they won't be prompted for by the underlying C functions. If the password_prompt argument (2nd arg) is not supplied, no prompt will be displayed, but a password must still be entered. The default behavior is the same as before.
-
- Jan 10, 2016
-
-
deuce authored
seen this in a regular build, so I'm not sure if this is a "real bug" or not.
-
- Nov 08, 2015
-
-
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...
-
- Aug 22, 2015
-
-
deuce authored
-
- Aug 17, 2015
-
-
rswindell authored
rather than 0 (a number) when the current sub-board or directory is invalid (e.g. no user logged in yet).
-
- Apr 29, 2015
-
-
deuce authored
-
- Mar 07, 2014
-
-
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.
-
- Mar 06, 2014
-
-
rswindell authored
avoid freeing NULL pointers when called without all the (optional) arguments.
-