• src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgdefs.h scfglib1.c scfgsave.c

    From rswindell@VERT to CVS commit on Monday, April 27, 2015 03:45:05
    src/sbbs3 main.cpp 1.610 1.611 readmail.cpp 1.61 1.62 readmsgs.cpp 1.68 1.69 sbbs.h 1.409 1.410 scansubs.cpp 1.17 1.18 scfgdefs.h 1.35 1.36 scfglib1.c 1.64 1.65 scfgsave.c 1.57 1.58
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv26106

    Modified Files:
    main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp
    scfgdefs.h scfglib1.c scfgsave.c
    Log Message:
    Enhancement at the request of Nightfox:
    Optionally, external modules may be executed in place of "built-in" operations for:
    - reading mail (email or netmail)
    - scanning posts (searching/scanning/reading a single sub-board)
    - scanning sub-boards (all, one, or a group)

    Each of these may be configured (in SCFG->System->Loadable Modules)
    with command-line options for a total length of up to 63 characters.

    Note to module programmers: each module here will be passed additional command-line arguments to indicate how or why the user operation was invoked.

    For the Reading Mail module, the 'which' value (in decimal) and the user-number is passed (in decimal). Usually the user-number will be the current user logged in, but not always (e.g. if the user is a sysop and reading other user's mail). The 'which' values (defined in load/sbbsdefs.js) of MAIL_YOUR, MAIL_SENT,
    and MAIL_ALL must be handled (MAIL_ANY won't be used).

    For the Scan Posts module, the sub-board number and scan mode (both in decimal) and the 'find' string (text being searched for) are passed as arguments
    (in that order). The scan mode values (defined in sbbsdefs.js) are the same as those supported by bbs.scan_posts(). All of the values should be supported
    and they can be combined (e.g. SCAN_CONST|SCAN_NEW
    and SCAN_NEW|SCAN_TOYOU). The 'find' string is only used if the SCAN_FIND mode bit is set. It is the responsibilty of the module (if configured) to enforce sub-board read access restrictions.

    For the Scan Subs module, the first argument is 1 if "all subs" are being scanned, 0 otherwise (normally the user is prompted for the breadth of the
    scan in this case, but that's up to the module author), and the scan 'mode' is passed in decimal, in that order. If the SCAN_FIND mode flag is passed in, this module should prompt the user for the text string to search for. If this module is not configured, the Scan Posts module will be executed for each sub-board scanned.

    Recursion protection was added, so it is actually possible for the Read Mail module, for example, to call bbs.read_mail() and it'll work, but why would you?

    If any of these user operations are initiated during logon, at the request of Baja or JavaScript module, or whatever, and if the module is actually configured (and not already executing to handle the operation), the module
    will be executed in-place-of the built-in functionality. Feedback welcome,


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Nightfox@VERT/DIGDIST to rswindell on Monday, April 27, 2015 19:50:38
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: rswindell to CVS commit on Mon Apr 27 2015 03:45:05

    Enhancement at the request of Nightfox:
    Optionally, external modules may be executed in place of "built-in" operations for:
    - reading mail (email or netmail)
    - scanning posts (searching/scanning/reading a single sub-board)
    - scanning sub-boards (all, one, or a group)

    Thanks for the update! I'm having a look at the new options now. I've put a JS script in place for the Read Mail option, and that seems to work as expected. I'm about to look into the others.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Monday, April 27, 2015 21:43:02
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Nightfox to rswindell on Mon Apr 27 2015 07:50 pm

    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: rswindell to CVS commit on Mon Apr 27 2015 03:45:05

    Enhancement at the request of Nightfox:
    Optionally, external modules may be executed in place of "built-in" operations for:
    - reading mail (email or netmail)
    - scanning posts (searching/scanning/reading a single sub-board)
    - scanning sub-boards (all, one, or a group)

    Thanks for the update! I'm having a look at the new options now. I've put a JS script in place for the Read Mail option, and that seems to work as expected. I'm about to look into the others.

    Cool. Are you testing the Kill/Read Sent Mail feature as well as the Read All Mail feature (e.g. the ;MAIL sysop command)?

    If you don't want your module to handle those scenarios, you can just call bbs.read_mail() in those situations if you like (one use case for the recursion
    protection).

    digital man

    Synchronet "Real Fact" #53:
    The Synchronet source code consists of over 500,000 lines of C and C++.
    Norco, CA WX: 69.3øF, 28.0% humidity, 4 mph SSE wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Tuesday, April 28, 2015 07:49:06
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Digital Man to Nightfox on Mon Apr 27 2015 21:43:02

    Cool. Are you testing the Kill/Read Sent Mail feature as well as the Read All Mail feature (e.g. the ;MAIL sysop command)?

    If you don't want your module to handle those scenarios, you can just call bbs.read_mail() in those situations if you like (one use case for the recursion protection).

    I've occasionally used the Read Sent Mail feature. My reader doesn't (yet) handle all the scenarios, so for the scenarios it doesn't handle, I plan to call the appropriate JS functions to use Synchronet's stock behavior.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Nightfox@VERT/DIGDIST to Digital Man on Tuesday, April 28, 2015 20:16:24
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: rswindell to CVS commit on Mon Apr 27 2015 03:45:05

    For the Scan Posts module, the sub-board number and scan mode (both in decimal) and the 'find' string (text being searched for) are passed as arguments (in that order). The scan mode values (defined in sbbsdefs.js) are the same as those supported by bbs.scan_posts(). All of the values should be supported and they can be combined (e.g. SCAN_CONST|SCAN_NEW and SCAN_NEW|SCAN_TOYOU). The 'find' string is only used if the SCAN_FIND mode bit is set. It is the responsibilty of the module (if configured) to enforce sub-board read access restrictions.

    For the Scan Subs module, the first argument is 1 if "all subs" are being scanned, 0 otherwise (normally the user is prompted for the breadth of the scan in this case, but that's up to the module author), and the scan 'mode' is passed in decimal, in that order. If the SCAN_FIND mode flag is passed in, this module should prompt the user for the text string to search for. If this module is not configured, the Scan Posts module will be executed for each sub-board scanned.

    Hi DM,

    I am a little confused on the difference between Scan Posts and Scan Subs, as well as the behavior of some of the SCAN_* bits defined in sbbsdefs.js.

    One thing is, from the Synchronet JS documentation, it looks like bbs.scan_msgs() performs the Scan Posts functionality? The JS documentation doesn't include scan_posts() as a function in the bbs object, but it says scan_msgs() is AKA scan_posts(). And indeed, if I set up a JS script for the Scan Posts module, that script gets called for bbs.scan_msgs(). The naming thew me off a bit (Scan Posts vs. scan_msgs). This is the JS documentation I am referring to:
    http://www.synchro.net/docs/jsobjs.html

    Also, I was having a look at classic_shell.js to see what it does for the 'S' command (scan for messages posted to you), and it calls bbs.scan_subs(SCAN_TOYOU). In my custom command shell, I was also using that for the same feature. When that runs, it asks whether you want to show only the message subjects. If you choose Yes, then it shows the message subjects for all messages posted to you. If you choose No, it lets you read the messages, but only new messages to you (not all messages to you, as the
    comment for SCAN_TOYOU suggests). So the messages it shows seems to be inconsistent depending on whether you choose to see only the message subjects or not.

    Also, from the JS documentation, it looks like the only major difference between scan_subs and scan_msgs (or Scan Posts) is that scan_msgs includes search text, whereas scan_subs doesn't - Is that correct?

    Another thing I noticed is that sbbsdefs.js defines SCAN_UNREAD, but I don't see that used anywhere in classic_shell.js. Is that equivalent to SCAN_NEW|SCAN_TOYOU?

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Nightfox@VERT/DIGDIST to Digital Man on Tuesday, April 28, 2015 20:28:35
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: rswindell to CVS commit on Mon Apr 27 2015 03:45:05

    Hi DM,

    I've started to set up a JS script for the Scan Subs loadable module. My reader doesn't yet handle all scan scenarios, so for the scenarios it doesn't handle, I plan to call bbs.scan_subs() and pass along the arguments that are passed to the Scan Subs module. As a test, I tried having my Scan Subs module just call bbs.scan_subs(), and I noticed that the mode bits don't seem to be passed through properly. For instance, if my Scan Subs module contains this code:

    var scanAllSubs = (argv[0] == 1);
    var scanMode = argv[1];
    bbs.scan_subs(scanMode, scanAllSubs);

    I noticed that if I then call bbs.scan_subs() from my command shell, it seems to do the same type of scan whether I pass SCAN_TOYOU or SCAN_NEW for the scan type. Both of those seem to end up doing a newscan (passing SCAN_TOYOU behaves the same as passing SCAN_NEW). If I then remove my Scan Subs module from the Loadable Modules configuration in SCFG, bbs.scan_subs() then behaves as expected.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Tuesday, April 28, 2015 23:49:56
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Nightfox to Digital Man on Tue Apr 28 2015 08:16 pm

    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: rswindell to CVS commit on Mon Apr 27 2015 03:45:05

    For the Scan Posts module, the sub-board number and scan mode (both in decimal) and the 'find' string (text being searched for) are passed as arguments (in that order). The scan mode values (defined in sbbsdefs.js) are the same as those supported by bbs.scan_posts(). All of the values should be supported and they can be combined (e.g. SCAN_CONST|SCAN_NEW and SCAN_NEW|SCAN_TOYOU). The 'find' string is only used if the SCAN_FIND mode bit is set. It is the responsibilty of the module (if configured) to enforce sub-board read access restrictions.

    For the Scan Subs module, the first argument is 1 if "all subs" are being scanned, 0 otherwise (normally the user is prompted for the breadth of the scan in this case, but that's up to the module author), and the scan 'mode' is passed in decimal, in that order. If the SCAN_FIND mode flag is passed in, this module should prompt the user for the text string to search for. If this module is not configured, the Scan Posts module will be executed for each sub-board scanned.

    Hi DM,

    I am a little confused on the difference between Scan Posts and Scan Subs, as well as the behavior of some of the SCAN_* bits defined in sbbsdefs.js.

    Scan Posts is what happens when you hit 'R' from the main menu of the classic shell to read a sub-board. It's also what is called for *each* sub-board you choose the scan in the various scan/search methods.

    Scan Subs is what happens when you hit 'N', '/N', 'S', '/S', 'F', 'Z', '/Z', 'B' or '/B', from the main menu of the classic shell. The non-slash variant prompts you for the scope of what to scan. The 'F' command prompts you for a string to search for. These prompts are handled by the "Scan Subs" code which then calls the Scan Posts code for each sub-board being scanned.

    One thing is, from the Synchronet JS documentation, it looks like bbs.scan_msgs() performs the Scan Posts functionality?

    Yup.

    The JS documentation
    doesn't include scan_posts() as a function in the bbs object, but it says scan_msgs() is AKA scan_posts(). And indeed, if I set up a JS script for the Scan Posts module, that script gets called for bbs.scan_msgs(). The naming thew me off a bit (Scan Posts vs. scan_msgs).

    It's the same thing.

    This is the JS
    documentation I am referring to:
    http://www.synchro.net/docs/jsobjs.html

    Yup, that's what aliases are, just 2 different names for the same thing for historic reasons. I'll change the SCFG menu option to read "Scan Msgs" instead of "Scan Posts".

    Also, I was having a look at classic_shell.js to see what it does for the 'S' command (scan for messages posted to you), and it calls bbs.scan_subs(SCAN_TOYOU). In my custom command shell, I was also using that for the same feature. When that runs, it asks whether you want to show only the message subjects. If you choose Yes, then it shows the message subjects for all messages posted to you. If you choose No, it lets you read the messages, but only new messages to you (not all messages to you, as the comment for SCAN_TOYOU suggests). So the messages it shows seems to be inconsistent depending on whether you choose to see only the message subjects or not.

    That's correct behavior. The prompt is somewhat misleading.

    Also, from the JS documentation, it looks like the only major difference between scan_subs and scan_msgs (or Scan Posts) is that scan_msgs includes search text, whereas scan_subs doesn't - Is that correct?

    No, bbs.scan_subs() will prompt the user for the scope of the scan and prompt you for the find string (like I described above). bbs.scan_subs() actually calls bbs.scan_msgs() (not exactly, but logically).

    Another thing I noticed is that sbbsdefs.js defines SCAN_UNREAD, but I don't see that used anywhere in classic_shell.js. Is that equivalent to SCAN_NEW|SCAN_TOYOU?

    The SCAN_UNREAD mode flag appears to have never been used in Synchronet (going back to Synchronet v2) so I guess it needs to be removed from sbbsdefs.js :-) SCAN_TOYOU performs this function.

    digital man

    Synchronet "Real Fact" #80:
    Vertrauen has had the FidoNet node number 1:103/705 since 1992.
    Norco, CA WX: 72.4øF, 26.0% humidity, 2 mph W wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Digital Man@VERT to Nightfox on Tuesday, April 28, 2015 23:52:58
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Nightfox to Digital Man on Tue Apr 28 2015 08:28 pm

    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: rswindell to CVS commit on Mon Apr 27 2015 03:45:05

    Hi DM,

    I've started to set up a JS script for the Scan Subs loadable module. My reader doesn't yet handle all scan scenarios, so for the scenarios it doesn't handle, I plan to call bbs.scan_subs() and pass along the arguments that are passed to the Scan Subs module. As a test, I tried having my Scan Subs module just call bbs.scan_subs(), and I noticed that the mode bits don't seem to be passed through properly. For instance, if my Scan Subs module contains this code:

    var scanAllSubs = (argv[0] == 1);
    var scanMode = argv[1];
    bbs.scan_subs(scanMode, scanAllSubs);

    I noticed that if I then call bbs.scan_subs() from my command shell, it seems to do the same type of scan whether I pass SCAN_TOYOU or SCAN_NEW for the scan type. Both of those seem to end up doing a newscan (passing SCAN_TOYOU behaves the same as passing SCAN_NEW). If I then remove my Scan Subs module from the Loadable Modules configuration in SCFG, bbs.scan_subs() then behaves as expected.

    The bbs.scan_subs() method uses the type of the arguments to determine which is
    being passed (the order or arity is not significant), so scanMode in this case is going to be a string (and ignored) unless you "cast" it to a Number, like so:

    bbs.scan_subs(Number(scanMode), scanAllSubs);

    digital man

    Synchronet "Real Fact" #27:
    Rob Swindell's first computer was a Commodore VIC-20 (1980).
    Norco, CA WX: 72.0øF, 27.0% humidity, 3 mph NNW wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Wednesday, April 29, 2015 07:31:15
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Digital Man to Nightfox on Tue Apr 28 2015 23:49:56

    I am a little confused on the difference between Scan Posts and Scan
    Subs, as well as the behavior of some of the SCAN_* bits defined in
    sbbsdefs.js.

    Scan Posts is what happens when you hit 'R' from the main menu of the classic shell to read a sub-board. It's also what is called for *each* sub-board you choose the scan in the various scan/search methods.

    Scan Subs is what happens when you hit 'N', '/N', 'S', '/S', 'F', 'Z', '/Z', 'B' or '/B', from the main menu of the classic shell. The non-slash variant prompts you for the scope of what to scan. The 'F' command prompts you for a string to search for. These prompts are handled by the "Scan Subs" code which then calls the Scan Posts code for each sub-board being scanned.
    Also, from the JS documentation, it looks like the only major
    difference between scan_subs and scan_msgs (or Scan Posts) is that
    scan_msgs includes search text, whereas scan_subs doesn't - Is that
    correct?

    No, bbs.scan_subs() will prompt the user for the scope of the scan and prompt you for the find string (like I described above). bbs.scan_subs() actually calls bbs.scan_msgs() (not exactly, but logically).

    Another thing I noticed is that sbbsdefs.js defines SCAN_UNREAD, but I
    Another thing I noticed is that sbbsdefs.js defines SCAN_UNREAD, but I
    don't see that used anywhere in classic_shell.js. Is that equivalent
    to SCAN_NEW|SCAN_TOYOU?

    The SCAN_UNREAD mode flag appears to have never been used in Synchronet (going back to Synchronet v2) so I guess it needs to be removed from sbbsdefs.js :-) SCAN_TOYOU performs this function.

    Thanks for the response & info.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Nightfox@VERT/DIGDIST to Digital Man on Wednesday, April 29, 2015 07:37:39
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Digital Man to Nightfox on Tue Apr 28 2015 23:52:58

    that the mode bits don't seem to be passed through properly. For
    instance, if my Scan Subs module contains this code:

    var scanAllSubs = (argv[0] == 1);
    var scanMode = argv[1];
    bbs.scan_subs(scanMode, scanAllSubs);

    I noticed that if I then call bbs.scan_subs() from my command shell,
    it seems to do the same type of scan whether I pass SCAN_TOYOU or
    SCAN_NEW for the scan type. Both of those seem to end up doing a
    newscan (passing SCAN_TOYOU behaves the same as passing SCAN_NEW). If
    I then remove my Scan Subs module from the Loadable Modules
    configuration in SCFG, bbs.scan_subs() then behaves as expected.

    The bbs.scan_subs() method uses the type of the arguments to determine which is being passed (the order or arity is not significant), so scanMode in this case is going to be a string (and ignored) unless you "cast" it to a Number, like so:

    bbs.scan_subs(Number(scanMode), scanAllSubs);

    I see, that makes sense. Thanks.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Nightfox@VERT/DIGDIST to Digital Man on Sunday, May 03, 2015 09:43:02
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: rswindell to CVS commit on Mon Apr 27 2015 03:45:05

    For the Scan Posts module, the sub-board number and scan mode (both in decimal) and the 'find' string (text being searched for) are passed as arguments (in that order).

    Hi DM,

    Is there an efficient way to get a sub-board internal code from the sub-board number in JS? Perhaps an array of sub-boards in JS indexed by the sub-board number? If I needed to get the sub-board code from the sub-board number, I suppose I could loop through the msg_area.sub array (which is indexed by internal code) and look for the sub-board with the matching number, but I'm wondering if there's a method that would be faster than doing a linear search.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Deuce@VERT/SYNCNIX to Nightfox on Sunday, May 03, 2015 13:10:12
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Nightfox to Digital Man on Sun May 03 2015 09:43 am

    Is there an efficient way to get a sub-board internal code from the sub-board number in JS? Perhaps an array of sub-boards in JS indexed by the sub-board number? If I needed to get the sub-board code from the sub-board number, I suppose I could loop through the msg_area.sub array (which is indexed by internal code) and look for the sub-board with the matching number, but I'm wondering if there's a method that would be faster than doing a linear search.

    It's pretty trivial to create this array yourself using the method you suggested.

    var sub_index={};
    var subs_by_number={}
    var i;
    for (i in msg_area.sub) {
    sub_index[msg_area.sub[i].number] = i
    subs_by_number[msg_area.sub[i].number] = msg_area.sub[i];
    }

    If you like, you can store it in bbs.mods and only re-create it if it doesn't already exist... just wrap an "if (bbs.mods.sub_index == undefined) {" around it.

    ---
    http://DuckDuckGo.com/ a better search engine that respects your privacy.
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Nightfox@VERT/DIGDIST to Deuce on Sunday, May 03, 2015 16:18:24
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Deuce to Nightfox on Sun May 03 2015 13:10:12

    Is there an efficient way to get a sub-board internal code from the
    sub-board number in JS? Perhaps an array of sub-boards in JS indexed
    by the sub-board number? If I needed to get the sub-board code from
    the sub-board number, I suppose I could loop through the msg_area.sub
    array (which is indexed by internal code) and look for the sub-board
    with the matching number, but I'm wondering if there's a method that
    would be faster than doing a linear search.

    It's pretty trivial to create this array yourself using the method you suggested.

    I don't need to create such an array; All I want to do is look up a sub-board code from its number without having to take time to loop through an array to search for it. I was just wondering if there was already some structure where it could be looked up or some function to look it up.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Deuce@VERT/SYNCNIX to Nightfox on Monday, May 04, 2015 10:31:16
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Nightfox to Deuce on Sun May 03 2015 04:18 pm

    It's pretty trivial to create this array yourself using the method you suggested.

    I don't need to create such an array; All I want to do is look up a sub-board code from its number without having to take time to loop through an array to search for it. I was just wondering if there was already some structure where it could be looked up or some function to look it up.

    If you created the array once, you would then have a structure where it could be looked up is what I was pointing out.

    ---
    http://DuckDuckGo.com/ a better search engine that respects your privacy.
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Nightfox@VERT/DIGDIST to Deuce on Monday, May 04, 2015 12:35:51
    It's pretty trivial to create this array yourself using the method you suggested.

    I don't need to create such an array; All I want to do is look up a sub-board code from its number without having to take time to loop through an array to search for it. I was just wondering if there was already some structure where it could be looked up or some function to look it up.

    If you created the array once, you would then have a structure where it could be looked up is what I was pointing out.

    True - but this is something my script will only do once. Building a structure would be more worth it if my script would be doing it multiple times. This is something I'll be doing with the new 'Scan Posts' loadable module, where one of the parameters Synchronet passes is a sub-board number. I want my script to look up the sub-board code based on that, which will happen only once.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Monday, May 04, 2015 17:43:31
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Nightfox to Deuce on Mon May 04 2015 12:35 pm

    It's pretty trivial to create this array yourself using the method you suggested.

    I don't need to create such an array; All I want to do is look up a sub-board code from its number without having to take time to loop through an array to search for it. I was just wondering if there was already some structure where it could be looked up or some function to look it up.

    If you created the array once, you would then have a structure where it could be looked up is what I was pointing out.

    True - but this is something my script will only do once. Building a structure would be more worth it if my script would be doing it multiple times. This is something I'll be doing with the new 'Scan Posts' loadable module, where one of the parameters Synchronet passes is a sub-board number. I want my script to look up the sub-board code based on that, which will happen only once.

    If I change that argument (to the module) from the subnum (which really is an sbbs internal concept) to the sub-board internal code, would that resolve it?

    digital man

    Synchronet "Real Fact" #18:
    The first Synchronet BBS (Vertrauen) went live in July of 1991 (replacing WWIV).
    Norco, CA WX: 66.6øF, 58.0% humidity, 10 mph ESE wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Monday, May 04, 2015 19:36:24
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Digital Man to Nightfox on Mon May 04 2015 17:43:31

    True - but this is something my script will only do once. Building a
    structure would be more worth it if my script would be doing it
    multiple times. This is something I'll be doing with the new 'Scan
    Posts' loadable module, where one of the parameters Synchronet passes
    is a sub-board number. I want my script to look up the sub-board code
    based on that, which will happen only once.

    If I change that argument (to the module) from the subnum (which really is an sbbs internal concept) to the sub-board internal code, would that resolve it?

    Yes, it would.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Monday, May 04, 2015 23:15:38
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Nightfox to Digital Man on Mon May 04 2015 07:36 pm

    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Digital Man to Nightfox on Mon May 04 2015 17:43:31

    True - but this is something my script will only do once. Building a
    structure would be more worth it if my script would be doing it
    multiple times. This is something I'll be doing with the new 'Scan
    Posts' loadable module, where one of the parameters Synchronet passes
    is a sub-board number. I want my script to look up the sub-board code
    based on that, which will happen only once.

    If I change that argument (to the module) from the subnum (which really is an sbbs internal concept) to the sub-board internal code, would that resolve it?

    Yes, it would.

    Okay, I'll do that then. You'll need to change your mod accordingly. :-)

    digital man

    Synchronet "Real Fact" #79:
    85 SBBSecho registrations were sold (at $49) between 1994 and 1996.
    Norco, CA WX: 54.6øF, 83.0% humidity, 4 mph SSE wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Tuesday, May 05, 2015 07:36:06
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Digital Man to Nightfox on Mon May 04 2015 23:15:38

    If I change that argument (to the module) from the subnum (which
    really is an sbbs internal concept) to the sub-board internal
    code, would that resolve it?

    Yes, it would.

    Okay, I'll do that then. You'll need to change your mod accordingly. :-)

    Thanks. :)

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Tuesday, May 05, 2015 14:23:31
    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Nightfox to Digital Man on Tue May 05 2015 07:36 am

    Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp scfgd
    By: Digital Man to Nightfox on Mon May 04 2015 23:15:38

    If I change that argument (to the module) from the subnum (which DM>> really is an sbbs internal concept) to the sub-board internal
    code, would that resolve it?

    Yes, it would.

    Okay, I'll do that then. You'll need to change your mod accordingly. :-)

    Thanks. :)

    Thank you. You're the guinea pig for that feature. I wasn't too thrilled with using arguments to pass the mode/state information, but in the end it seemed the best option that would work with both JS and Baja (though it seems very unlikely someone would be able to write one of these mods in Baja).

    digital man

    Synchronet "Real Fact" #50:
    Rob Swindell was introduced to BBSing in 1982 by his older brother, Dr. Seuss. Norco, CA WX: 66.7øF, 54.0% humidity, 9 mph ESE wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Tuesday, May 05, 2015 17:19:33
    Thank you. You're the guinea pig for that feature. I wasn't too thrilled with using arguments to pass the mode/state information, but in the end it seemed the best option that would work with both JS and Baja (though it seems very unlikely someone would be able to write one of these mods in Baja).

    It seems to work decently well for JS. And thanks for adding those loadable modules options.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Accession@VERT/PHARCYDE to Digital Man on Tuesday, May 05, 2015 19:06:52
    Hello Digital,

    On 05 May 15 14:23, Digital Man wrote to Nightfox:

    Thank you. You're the guinea pig for that feature. I wasn't too
    thrilled with using arguments to pass the mode/state information, but
    in the end it seemed the best option that would work with both JS and
    Baja (though it seems very unlikely someone would be able to write one
    of these mods in Baja).

    Oh you know damn well who would contradict you on that by saying they've already done it even though it's nowhere to be found. :)

    Regards,
    Nick

    --- GoldED+/LNX 1.1.5-b20130910
    * Origin: thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin) (723:1/701)
    þ Synchronet þ thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin)
  • From Nightfox@VERT/DIGDIST to Accession on Tuesday, May 05, 2015 18:50:47
    Re: Re: src/sbbs3/main.cpp readmail.cpp readmsgs.cpp sbbs.h scansubs.cpp s
    By: Accession to Digital Man on Tue May 05 2015 19:06:52

    Thank you. You're the guinea pig for that feature. I wasn't too
    thrilled with using arguments to pass the mode/state information,
    but in the end it seemed the best option that would work with both
    JS and Baja (though it seems very unlikely someone would be able to
    write one of these mods in Baja).

    Oh you know damn well who would contradict you on that by saying they've already done it even though it's nowhere to be found. :)

    I had the same thought... ;)

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com