• Message header total_vote

    From Nightfox@VERT/DIGDIST to Digital Man on Tue Apr 23 16:35:00 2019
    Hi DM,

    In my message reader, I have it display the upvotes, downvotes, and score as header information above the message. It was using
    the total_votes and upvotes properties of the message headers. Recently though, it seems those properties no longer exist in the
    message header objects. Has something changed recently regarding those message header properties?

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Tue Apr 23 17:25:00 2019
    Re: Message header total_votes and upvotes properties
    By: Nightfox to Digital Man on Tue Apr 23 2019 08:35 pm

    Hi DM,

    In my message reader, I have it display the upvotes, downvotes, and score as header information above the message. It was using the total_votes and upvotes properties of the message headers. Recently though, it seems those properties no longer exist in the message header objects. Has something changed recently regarding those message header properties?

    Those header properties are only calculated and added the header object when using the MsgBase.get_all_msg_headers() method. Are you?

    digital man

    This Is Spinal Tap quote #46:
    "Not an Exit" - we don't want an exit. Well that's true.
    Norco, CA WX: 66.0øF, 58.0% humidity, 0 mph SSW wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Wed Apr 24 04:24:00 2019
    Re: Message header total_votes and upvotes properties
    By: Digital Man to Nightfox on Tue Apr 23 2019 09:25 pm

    In my message reader, I have it display the upvotes, downvotes, and
    score as header information above the message. It was using the
    total_votes and upvotes properties of the message headers. Recently
    though, it seems those properties no longer exist in the message
    header objects. Has something changed recently regarding those
    message header properties?

    Those header properties are only calculated and added the header object when using the MsgBase.get_all_msg_headers() method. Are you?

    I am calling that, at least when I first enter a sub-board. I did a test yesterday where I posted a message in one of my local sub-boards and then upvoted it, then exited out of my reader and ran my reader again, but it still wasn't showing the score for the message. It would show the score in the
    past, which was why I was wondering if something had changed recently in the JS API. I'll have to double-check my reader code.

    Also, when a user votes on a message, I wanted my reader to be able to re-fetch just that one header from the msgbase to get the up-to-date vote data. I'd think it might be inefficient to call get_all_msg_headers() to do that, but if a user votes on a message, perhaps my reader could calculate the difference in up/downvotes (or poll vote) in that case?

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Nightfox@VERT/DIGDIST to Digital Man on Wed Apr 24 09:11:00 2019
    Re: Message header total_votes and upvotes properties
    By: Digital Man to Nightfox on Tue Apr 23 2019 09:25 pm

    Those header properties are only calculated and added the header object when using the MsgBase.get_all_msg_headers() method. Are you?

    I see where the problem is. It's due to a recent update I made to my reader. I had started using the get_index() function, thinking it would be a faster way to filter vote messages out of the list of messages, and loading only the non-vote messages for display. I suppose I'll have to just use get_all_msg_headers().

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Wed Apr 24 11:16:00 2019
    Re: Message header total_votes and upvotes properties
    By: Nightfox to Digital Man on Wed Apr 24 2019 01:11 pm

    Re: Message header total_votes and upvotes properties
    By: Digital Man to Nightfox on Tue Apr 23 2019 09:25 pm

    Those header properties are only calculated and added the header object when using the MsgBase.get_all_msg_headers() method. Are you?

    I see where the problem is. It's due to a recent update I made to my reader. I had started using the get_index() function, thinking it would be a faster way to filter vote messages out of the list of messages, and loading only the non-vote messages for display. I suppose I'll have to just use get_all_msg_headers().

    When a message is voted on, the original message header is not modified - new message headers are added and distributed over the message network(s). That's why get_all_msg_headers() is needed to tally the votes.

    digital man

    Synchronet "Real Fact" #22:
    The second ever Synchronet BBS was the Mid-Nite Hacker BBS (sysop: The Zapper). Norco, CA WX: 81.2øF, 41.0% humidity, 17 mph NE wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Wed Apr 24 11:49:00 2019
    Re: Message header total_votes and upvotes properties
    By: Digital Man to Nightfox on Wed Apr 24 2019 03:16 pm

    When a message is voted on, the original message header is not modified - new message headers are added and distributed over the message network(s). That's why get_all_msg_headers() is needed to tally the votes.

    I see, thanks.

    Nightfox

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