• rswindell's avatar
    Enhancement at the request of Nightfox: · d57c3830
    rswindell authored
    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,
    d57c3830
readmail.cpp 21.4 KB