• MsgBase.get_msg_header() including votes

    From Nightfox@VERT/DIGDIST to Digital Man on Thu Nov 23 11:01:20 2023
    Hi DM,

    When using MsgBase.get_msg_header() with the include_votes parameter set to true, should the header have valid total_votes and upvotes properties? I've tried using get_msg_header() with the include_votes parameter set to true, with a message I know has upvotes, but it seems its total_votes and upvotes are 0. However, when I use get_all_msg_headers() and tell it to include votes, that message header has the expected values for total_votes and upvotes. I'm not sure if that's by design or if this is a bug.

    My Synchronet binaries were built on November 11th.

    Nightfox

    ---
    ■ Synchronet ■ Digital Distortion: digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Thu Nov 23 14:43:35 2023
    Re: MsgBase.get_msg_header() including votes
    By: Nightfox to Digital Man on Thu Nov 23 2023 11:01 am

    Hi DM,

    When using MsgBase.get_msg_header() with the include_votes parameter set to true, should the header have valid total_votes and upvotes properties? I've tried using get_msg_header() with the include_votes parameter set to true, with a message I know has upvotes, but it seems its total_votes and upvotes are 0. However, when I use get_all_msg_headers() and tell it to include votes, that message header has the expected values for total_votes and upvotes. I'm not sure if that's by design or if this is a bug.

    My Synchronet binaries were built on November 11th.

    That's by design. In order to calculate a message's vote totals, the entire messagebase index must be read (and used). Voting on a messsage does not modify the message header of that message but creates a new message header that references the message being voted on. I think the MsgBase.get_index() method could be enhanced to calculate the votes and return the tally in its returned array of index objects, if that helps you (it doesn't do that currently).
    --
    digital man (rob)

    Breaking Bad quote #43:
    Congratulations! You're now officially the cute one of the group.
    Norco, CA WX: 69.3°F, 52.0% humidity, 10 mph E wind, 0.00 inches rain/24hrs

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Fri Nov 24 15:45:34 2023
    Re: MsgBase.get_msg_header() including votes
    By: Digital Man to Nightfox on Thu Nov 23 2023 02:43 pm

    When using MsgBase.get_msg_header() with the include_votes parameter set to
    true, should the header have valid total_votes and upvotes properties?
    I've tried using get_msg_header() with the include_votes parameter set to
    true, with a message I know has upvotes, but it seems its total_votes and
    upvotes are 0. However, when I use get_all_msg_headers() and tell it to

    That's by design. In order to calculate a message's vote totals, the entire messagebase index must be read (and used). Voting on a messsage does not modify the message header of that message but creates a new message header that references the message being voted on. I think the MsgBase.get_index() method could be enhanced to calculate the votes and return the tally in its returned array of index objects, if that helps you (it doesn't do that currently).

    I see. What I've done in part of DDMsgReader where I want to see vote totals & tallies is to call get_all_msg_headers() and check the header by message number. I'll leave it that way.

    Nightfox

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