Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Stamp out philately.


dovenet / Synchronet Javascript / MsgBase.get_msg_header() including votes

SubjectAuthor
* MsgBase.get_msg_header() including votesNightfox
`* MsgBase.get_msg_header() including votesDigital Man
 `- MsgBase.get_msg_header() including votesNightfox

1
MsgBase.get_msg_header() including votes

<655FA180.3888.dove_sync_js@digitaldistortionbbs.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=115&group=DOVE-Net.Synchronet_Javascript#115

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: nightfox@VERT/DIGDIST (Nightfox)
To: Digital Man
Subject: MsgBase.get_msg_header() including votes
Message-ID: <655FA180.3888.dove_sync_js@digitaldistortionbbs.com>
Date: Thu, 23 Nov 2023 11:01:20 -0800
X-Comment-To: Digital Man
Path: rocksolidbbs.com!not-for-mail
Organization: Digital Distortion
Newsgroups: DOVE-Net.Synchronet_Javascript
X-FTN-PID: Synchronet 3.20a-Linux master/47773812d Nov 11 2023 GCC 11.4.0
X-FTN-CHRS: CP437 2
WhenImported: 20231123111712-0800 41e0
WhenExported: 20231123141323-0800 41e0
ExportedFrom: VERT sync-js 3959
WhenImported: 20231123110120-0800 41e0
WhenExported: 20231123111713-0800 41e0
ExportedFrom: DIGDIST dove_sync_js 3888
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Nightfox - Thu, 23 Nov 2023 19:01 UTC

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

MsgBase.get_msg_header() including votes

<655FD597.3960.sync-js@vert.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=116&group=DOVE-Net.Synchronet_Javascript#116

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: digital.man@VERT (Digital Man)
To: Nightfox
Subject: MsgBase.get_msg_header() including votes
Message-ID: <655FD597.3960.sync-js@vert.synchro.net>
Date: Thu, 23 Nov 2023 14:43:35 -0800
X-Comment-To: Nightfox
Path: rocksolidbbs.com!not-for-mail
Organization: Vertrauen
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <655FA180.3888.dove_sync_js@digitaldistortionbbs.com>
References: <655FA180.3888.dove_sync_js@digitaldistortionbbs.com>
X-FTN-PID: Synchronet 3.20a-Win32 master/13b07dbad Nov 22 2023 MSC 1916
X-FTN-CHRS: CP437 2
WhenImported: 20231123144335-0800 41e0
WhenExported: 20231123201315-0800 41e0
ExportedFrom: VERT sync-js 3960
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Digital Man - Thu, 23 Nov 2023 22:43 UTC

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

MsgBase.get_msg_header() including votes

<6561359E.3890.dove_sync_js@digitaldistortionbbs.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=117&group=DOVE-Net.Synchronet_Javascript#117

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: nightfox@VERT/DIGDIST (Nightfox)
To: Digital Man
Subject: MsgBase.get_msg_header() including votes
Message-ID: <6561359E.3890.dove_sync_js@digitaldistortionbbs.com>
Date: Fri, 24 Nov 2023 15:45:34 -0800
X-Comment-To: Digital Man
Path: rocksolidbbs.com!not-for-mail
Organization: Digital Distortion
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <655FD597.3960.sync-js@vert.synchro.net>
References: <655FD597.3960.sync-js@vert.synchro.net>
X-FTN-PID: Synchronet 3.20a-Linux master/47773812d Nov 11 2023 GCC 11.4.0
X-FTN-CHRS: CP437 2
WhenImported: 20231124155111-0800 41e0
WhenExported: 20231124201320-0800 41e0
ExportedFrom: VERT sync-js 3961
WhenImported: 20231124154534-0800 41e0
WhenExported: 20231124155116-0800 41e0
ExportedFrom: DIGDIST dove_sync_js 3890
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Nightfox - Fri, 24 Nov 2023 23:45 UTC

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

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


dovenet / Synchronet Javascript / MsgBase.get_msg_header() including votes

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor