• bbs.scan_msgs()

    From Khelair@VERT/TINFOIL to All on Friday, August 22, 2014 21:37:27
    I'm still relatively new to actually learning the Synchronet SSJS api, obviously. I've found that the behavior I want to create with the command shell that I am writing, specifically within bbs.scan_msgs(), is not possible utilizing this method/function. I figured, after a bit, that it wasn't present within the JS API, so far as I could tell, so I started delving into the .js, .src, and finally the source directory's .c and .h files, looking for the code for it, to figure out best how to re-implement (or configure it, if possible). Haven't been able to find anything yet, and my searches on synchro.net and wiki.synchro.net haven't told me anything about finding scan_msgs() or bbs.scan_msgs(). Can anybody tell me where I can find the code for these API implementations so that I can get a better idea of what I'm dealing with?
    Much appreciated!

    ---
    þ Synchronet þ Tinfoil Tetrahedron BBS telnet or ssh -p 2222 to tinfoil.synchro.net
  • From echicken@VERT/ECBBS to Khelair on Saturday, August 23, 2014 01:31:27
    Re: bbs.scan_msgs()
    By: Khelair to All on Fri Aug 22 2014 21:37:27

    obviously. I've found that the behavior I want to create with the
    command shell that I am writing, specifically within bbs.scan_msgs(), is
    not possible utilizing this method/function. I figured, after a bit,

    What behaviour are you trying to implement, exactly? There is (usually) enough functionality in the JS API to do just about anything you need to, messagebase-wise.

    started delving into the .js, .src, and finally the source directory's
    .c and .h files, looking for the code for it, to figure out best how to
    re-implement (or configure it, if possible). Haven't been able to find

    Unless you're going to modify the source, or are really interested in the vast innards of Synchronet, there isn't much point in looking there. The information is in the JS object model docs, though it's not always obvious. Let us know what you want to do and we can point you in the right direction.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From Khelair@VERT/TINFOIL to echicken on Saturday, August 23, 2014 11:31:19
    Re: bbs.scan_msgs()
    By: echicken to Khelair on Sat Aug 23 2014 01:31:27

    What behaviour are you trying to implement, exactly? There is (usually) enough functionality in the JS API to do just about anything you need to, messagebase-wise.

    Well, I actually ended up following through on my [too oft] pattern of thinking that I had looked well enough, asking a question, and then finding out I've got to go grab a beverage to wash my foot down my mouth all the way.
    I'm looking to implement a very simple message scanning function; it basically has the exact same functionality as bbs.scan_msgs(), but with a much more terse set of headers, and specific color sets. It's exceedingly simple, I'm just trying to implement the look and feel of a much more limited BBS system for some people that I know who were displaced from their close-knit, generation-spanning time on a now [practically] extinct BBS family line.
    I haven't spent a whole lot of time, previously, looking into APIs in order to find out what I'm dealing with for functionality. My experience is really piecemeal, and when I've had to learn other codebases before I've had to do it primarily from digging through raw, relatively uncommented code.
    Once I started spending some more time (after what I saw that you wrote here causing me to question myself a bit more) looking through the API, I started realizing that msg_area.* might be able to provide the low level functionality I'm looking for. Right now I'm implementing it from a level of just writing my entire scan_subs() clone, iterating through all of the user's potential groups/subs with a structure like this:

    for each (uGrp in msg_area.grp_list) {
    for (var subNdx = 0; subNdx++;
    subNdx < msg_area.grp_list.length) {
    //etc etc etc
    }
    }

    Please note, I haven't looked at that code since my sleep-deprived time last night, if there's a stupid error please don't make too many quick assumptions, I catch a lot of shit my first time running a script, usually.

    Unless you're going to modify the source, or are really interested in the vast innards of Synchronet, there isn't much point in looking there. The information is in the JS object model docs, though it's not always obvious. Let us know what you want to do and we can point you in the right direction.

    Well I am curious as to its internals, but I'm almost certainly not going to be modifying the internals now. I'm planning on looking into the innards more, at some point, for some functionality that I want to change slightly or add, but most of it is well above my level right now.
    If you've got any comments or suggestions on what I'm doing right now it'd certainly be appreciated. :)
    Thanks for your info so far!

    ---
    þ Synchronet þ Tinfoil Tetrahedron BBS telnet or ssh -p 2222 to tinfoil.synchro.net
  • From echicken@VERT/ECBBS to Khelair on Sunday, August 24, 2014 01:34:43
    Re: bbs.scan_msgs()
    By: Khelair to echicken on Sat Aug 23 2014 11:31:19

    causing me to question myself a bit more) looking through the API, I
    started realizing that msg_area.* might be able to provide the low level
    functionality I'm looking for. Right now I'm implementing it from a

    You're on the right track. I believe there's a scan_ptr property for each sub in the sub_list array, so you can check message numbers against that to see if they are new for a given user.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From Nightfox@VERT/DIGDIST to Khelair on Friday, August 29, 2014 07:50:53
    Re: bbs.scan_msgs()
    By: Khelair to All on Fri Aug 22 2014 21:37:27

    I'm still relatively new to actually learning the Synchronet SSJS api, obviously. I've found that the behavior I want to create with the
    command shell that I am writing, specifically within bbs.scan_msgs(), is not possible utilizing this method/function. I figured, after a bit,
    that it wasn't present within the JS API, so far as I could tell, so I started delving into the .js, .src, and finally the source directory's
    .c and .h files, looking for the code for it, to figure out best how to re-implement (or configure it, if possible).

    Although it's great to have the Synchronet source available to customize, I think it might be better to write your own script in JavaScript to do what you want. The problem with modifying Synchronet's source is that if you ever want to upgrade your Synchronet binaries, doing so could be difficult, since you would have to re-apply your changes to the source when you upgrade, then re-build it. Also, if that section of code changes significantly, you would have a problem applying your changes. If you implement what you want as a JavaScript script, you wouldn't have to worry about making changes to the Synchronet code when you upgrade.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Khelair@VERT/TINFOIL to Nightfox on Friday, August 29, 2014 12:52:49
    Re: bbs.scan_msgs()
    By: Nightfox to Khelair on Fri Aug 29 2014 07:50:53

    Although it's great to have the Synchronet source available to customize, I think it might be better to write your own script in JavaScript to do what y want. The problem with modifying Synchronet's source is that if you ever wa to upgrade your Synchronet binaries, doing so could be difficult, since you would have to re-apply your changes to the source when you upgrade, then re-build it. Also, if that section of code changes significantly, you would have a problem applying your changes. If you implement what you want as a JavaScript script, you wouldn't have to worry about making changes to the Synchronet code when you upgrade.

    Aye, that's now what I'm engaged in. :) I understand the difficulties in patching and upgrading; I was just struggling to wrap my head around the problem I was working with in relation to the JavaScript API. Turns out I was neglecting the MsgBase object, due to a misunderstanding of its proper context. I'm on the path to getting it done properly now. :)
    Thank you!

    ---
    þ Synchronet þ Tinfoil Tetrahedron BBS telnet or ssh -p 2222 to tinfoil.synchro.net
  • From Nightfox@VERT/DIGDIST to Khelair on Friday, August 29, 2014 21:03:16
    Re: bbs.scan_msgs()
    By: Khelair to Nightfox on Fri Aug 29 2014 12:52:49

    Aye, that's now what I'm engaged in. :) I understand the difficulties in patching and upgrading; I was just struggling to wrap my head around the problem I was working with in relation to the JavaScript API. Turns out I was neglecting the MsgBase object, due to a misunderstanding of
    its proper context. I'm on the path to getting it done properly now. :)

    Ah, yes, Synchronet provides good support for accessing its message bases in JavaScript. It's not all completely documented though (the message header object isn't included in the Synchronet JavaScript documentation at http://www.synchro.net/docs/jsobjs.html). You can easily print out the fields & values in a message header object though (and this goes for any JavaScript object):

    for (var propertyName in theObject)
    console.print(propertyName + ": " + theObject[propertyName] + "\r\n"); console.pause();

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.com
  • From Khelair@VERT/TINFOIL to Nightfox on Saturday, August 30, 2014 00:44:51
    Re: bbs.scan_msgs()
    By: Nightfox to Khelair on Fri Aug 29 2014 21:03:16

    Ah, yes, Synchronet provides good support for accessing its message bases in JavaScript. It's not all completely documented though (the message header object isn't included in the Synchronet JavaScript documentation at http://www.synchro.net/docs/jsobjs.html). You can easily print out the fiel & values in a message header object though (and this goes for any JavaScript object):

    Hey, thank you! Good information to be aware of, and I'll admit, it has been awhile; I'm not remembering all of the tricks of the trade like that offhand. :)

    ---
    þ Synchronet þ Tinfoil Tetrahedron BBS telnet or ssh -p 2222 to tinfoil.synchro.net
  • From echicken@VERT/ECBBS to Nightfox on Saturday, August 30, 2014 12:23:26
    Re: bbs.scan_msgs()
    By: Nightfox to Khelair on Fri Aug 29 2014 21:03:16

    bases in JavaScript. It's not all completely documented though (the message header object isn't included in the Synchronet JavaScript documentation at http://www.synchro.net/docs/jsobjs.html). You can

    The header is described in the documentation of the MsgBase.save_msg() method, but yeah - just printing out the fields of the object is easy enough (and a good practical example.)

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From Nightfox@VERT/DIGDIST to echicken on Saturday, August 30, 2014 10:47:12
    Re: bbs.scan_msgs()
    By: echicken to Nightfox on Sat Aug 30 2014 12:23:26

    The header is described in the documentation of the MsgBase.save_msg() method, but yeah - just printing out the fields of the object is easy enough (and a good practical example.)

    You're right.. I guess I hadn't noticed when I checked the Synchronet JavaScript documentation last time.

    Nightfox

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