• Local messages, from_net_type is not NET_NONE

    From Nightfox@VERT/DIGDIST to Digital Man on Wednesday, May 13, 2020 19:28:05
    Hi DM,

    In the past, while working on my message reader, I noticed that emails posted locally (from one local user to another) had a header with from_net_type of NET_NONE. Recently, after updating my Synchronet build, that seems to be no longer the case. In my message reader, when replying to an email, if from_net_type is not NET_NONE, I have my reader look for a from_net_addr to send the reply to. For local emails to me, from_net_type is not NET_NONE, but from_net_addr is empty, so it doesn't know the destination address.

    I was using a recent build, but tried updating to the latest to see if it changed, but I'm still seeing this issue. I'm using the nightly build from May 13th.

    Was this a change that was done by design?

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Wednesday, May 13, 2020 20:16:39
    Re: Local messages, from_net_type is not NET_NONE
    By: Nightfox to Digital Man on Wed May 13 2020 07:28 pm

    Hi DM,

    In the past, while working on my message reader, I noticed that emails posted locally (from one local user to another) had a header with from_net_type of NET_NONE. Recently, after updating my Synchronet build, that seems to be no longer the case.

    If there's no from_net_addr field, then there should also be no from_net_type field. There was a bug recently fixed whereby the from_net_type field would be missing from MsgBase.get_msg_header() returned objects when the from_net_type was NET_NONE, unless the "expand fields" option was used.

    In my message reader, when replying to
    an email, if from_net_type is not NET_NONE, I have my reader look for a from_net_addr to send the reply to.

    Ideally, you'd look at the replyto_net_type/addr field first, but yeah, that's the basic algorithm.

    For local emails to me, from_net_type
    is not NET_NONE, but from_net_addr is empty, so it doesn't know the destination address.

    The from_net_type header field will be absent / undefined. So just checking if(hdr.from_net_type) is all you need to do as NET_NONE is 0. Both undefined and 0 evaluate to the same boolean result.

    I was using a recent build, but tried updating to the latest to see if it changed, but I'm still seeing this issue. I'm using the nightly build from May 13th.

    Was this a change that was done by design?

    Yes. http://cvs.synchro.net/cgi-bin/viewcvs.cgi/src/sbbs3/js_msgbase.c

    digital man

    Synchronet "Real Fact" #8:
    Synchronet was originally intended as a replacement for WWIV BBS software. Norco, CA WX: 62.5øF, 68.0% humidity, 9 mph ESE wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Wednesday, May 13, 2020 22:28:33
    Re: Local messages, from_net_type is not NET_NONE
    By: Digital Man to Nightfox on Wed May 13 2020 08:16 pm

    If there's no from_net_addr field, then there should also be no from_net_type field.

    Ah. I had this line in my .js script (pMsgHdr is a message header passed in to the function):
    if (pMsgHdr.from_net_type != NET_NONE)

    I found from_net_type was undefined, but it was passing that condition (which makes sense, since it isn't NET_NONE), and from_net_addr was also undefined. So this was a case where from_net_type and from_net_addr were both undefined, as you have described. So I know what to fix. :)

    Nightfox

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