Skip to content
Snippets Groups Projects
Commit 6be2e920 authored by Eric Oulashin's avatar Eric Oulashin Committed by Rob Swindell
Browse files

DDMsgReader bug fix: When viewing a poll that the user has posted and showing...

DDMsgReader bug fix: When viewing a poll that the user has posted and showing who voted on the poll, ensure it only counts poll responses (not reply messages). Reported by nelgin
parent a8cf3669
Branches
Tags
1 merge request!474DDMsgReader bug fix: When viewing a poll that the user has posted and showing who voted on the poll, ensure it only counts poll responses (not reply messages). Reported by nelgin
......@@ -185,6 +185,9 @@
* window, if there's an area change header in use, refresh it
* and the header lines, since the scrollable help window would
* display over them.
* 2024-11-20 Eric Oulashin Version 1.96c
* Bug fix: When showing a poll vote from the user, it should
* show people who've voted - ensure it only counts vote responses
*/
 
"use strict";
......@@ -292,8 +295,8 @@ var hexdump = load('hexdump_lib.js');
 
 
// Reader version information
var READER_VERSION = "1.96b";
var READER_DATE = "2024-11-03";
var READER_VERSION = "1.96c";
var READER_DATE = "2024-11-20";
 
// Keyboard key codes for displaying on the screen
var UP_ARROW = ascii(24);
......@@ -18708,7 +18711,9 @@ function DigDistMsgReader_GetMsgBody(pMsgHdr)
if ((msgFromUpper == user.name.toUpperCase()) || (msgFromUpper == user.handle.toUpperCase()))
{
// Check all the messages in the messagebase after the current one
// to find poll response messages
// to find ballots for this poll. For ballots, append the 'user voted'
// string to the message body.
// Get the line from text.dat for writing who voted & when. It
// is a format string and should look something like this:
//"\r\n\x01n\x01hOn %s, in \x01c%s \x01n\x01c%s\r\n\x01h\x01m%s voted in your poll: \x01n\x01h%s\r\n" 787 PollVoteNotice
......@@ -18717,28 +18722,52 @@ function DigDistMsgReader_GetMsgBody(pMsgHdr)
// Pass true to get_all_msg_headers() to tell it to return vote messages
// (the parameter was introduced in Synchronet 3.17+)
var tmpHdrs = msgbase.get_all_msg_headers(true);
// Get the current sub-board's group name and configuration name, for use
// with the 'user voted' text
//var indexRecords = []; // Index records; faster than getting full message header objects
var grpName = "";
var msgbaseCfgName = "";
var msgbase = new MsgBase(this.subBoardCode);
if (msgbase.open())
{
//indexRecords = msgbase.get_index();
grpName = msgbase.cfg.grp_name;
msgbaseCfgName = msgbase.cfg.name;
msgbase.close();
}
for (var tmpProp in tmpHdrs)
{
if (tmpHdrs[tmpProp] == null)
continue;
// If this header's thread_back or reply_id matches the poll message
// number, then append the 'user voted' string to the message body.
if ((tmpHdrs[tmpProp].thread_back == pMsgHdr.number) || (tmpHdrs[tmpProp].reply_id == pMsgHdr.id))
if (tmpHdrs[tmpProp].type == MSG_TYPE_BALLOT && (tmpHdrs[tmpProp].thread_back == pMsgHdr.number || tmpHdrs[tmpProp].reply_id == pMsgHdr.id))
{
var msgWrittenLocalTime = msgWrittenTimeToLocalBBSTime(tmpHdrs[tmpProp]);
var voteDate = strftime("%a %b %d %Y %H:%M:%S", msgWrittenLocalTime);
var grpName = "";
var msgbaseCfgName = "";
var msgbase = new MsgBase(this.subBoardCode);
retObj.msgBody += format(userVotedInYourPollText, voteDate, grpName, msgbaseCfgName, tmpHdrs[tmpProp].from, pMsgHdr.subject);
}
}
// we could check the index records this way:
/*
for (var i = 0; i < indexRecords.length; ++i)
{
if (Boolean(indexRecords[i].attr & MSG_VOTE) && indexRecords[i].remsg == pMsgHdr.number)
{
// Get the 'from' name for this ballot
var ballotFromName = "";
if (msgbase.open())
{
grpName = msgbase.cfg.grp_name;
msgbaseCfgName = msgbase.cfg.name;
// TODO: get_msg_header() is returning null here..?
var tmpHdr = msgbase.get_msg_header(false, indexRecords[i].number);
msgbase.close();
if (tmpHdr != null)
ballotFromName = tmpHdr.from;
}
retObj.msgBody += format(userVotedInYourPollText, voteDate, grpName, msgbaseCfgName, tmpHdrs[tmpProp].from, pMsgHdr.subject);
var msgWrittenLocalTime = msgWrittenTimeToLocalBBSTime(indexRecords[i]);
var voteDate = strftime("%a %b %d %Y %H:%M:%S", msgWrittenLocalTime);
retObj.msgBody += format(userVotedInYourPollText, voteDate, grpName, msgbaseCfgName, ballotFromName, pMsgHdr.subject);
}
}
*/
}
}
}
......@@ -5,7 +5,7 @@
// If you have DDMsgReader in a directory other than xtrn/DDMsgReader, then the changes to
// DDMsgReader.cfg will be saved in that directory (assuming you're running ddmr_cfg.js from
// that same directory).
// Currently for DDMsgReader 1.96b.
// Currently for DDMsgReader 1.96c.
//
// If you're running DDMsgReader from xtrn/DDMsgReader (the standard location) and you want
// to save the configuration file there (rather than sbbs/mods), you can use one of the
......@@ -18,7 +18,7 @@ require("sbbsdefs.js", "P_NONE");
require("uifcdefs.js", "UIFC_INMSG");
if (!uifc.init("DigDist. Message Reader 1.96b Configurator"))
if (!uifc.init("DigDist. Message Reader 1.96c Configurator"))
{
print("Failed to initialize uifc");
exit(1);
......
Digital Distortion Message Reader
Version 1.96b
Release date: 2024-11-03
Version 1.96c
Release date: 2024-11-20
by
......@@ -1318,7 +1318,7 @@ This is an example of the sub-board menu that appears in indexed mode - And from
here, the user can choose a sub-board to read:
Description Total New Last Post
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
AGN GEN - General Chat 1004 0 2023-04-02
AGN BBS - BBS Discussion 1000 0 2023-01-17
NEW AGN ART - Art/Demo Scene 603 1 2023-04-02
......@@ -1327,7 +1327,7 @@ NEW AGN ART - Art/Demo Scene 603 1 2023-04-02
AGN L46 - League Scores & Recons 1000 0 2016-09-10
NEW AGN TST - Testing Setups 2086 10 2023-04-03
AGN SYS - Sysops Only 1000 0 2023-01-19
��������������� FIDO - FidoNet ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
��������������������������������������������� FIDO - FidoNet ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
NEW BBS CARNIVAL - BBS Software Chatter 660 5 2023-04-04
BBS INTERNET - DOS/Win/OS2/Unix Internet BBS Applicatio 18 0 2023-03-04
CHWARE - Cheepware Support/Discussion 111 0 2023-03-16
......@@ -1360,20 +1360,20 @@ added for a user will be preserved (DDMsgReader does a bitwise 'or').
A quick-validation set in CFG is a set that includes a security level, flag
sets, exemptions, restrictions, and additional credits. For example:
���[���][?]������������������������������������������������������������
��� Quick-Validation Values ���
���������������������������������������������������������������������������������
��� ?0 SL: 5 F1: ���
��� ?1 SL: 10 F1: ���
��� ?2 SL: 20 F1: ���
��� ?3 SL: 30 F1: ���
��� ?4 SL: 40 F1: ���
��� ?5 SL: 50 F1: ���
��� ?6 SL: 60 F1: ���
��� ?7 SL: 70 F1: ���
��� ?8 SL: 80 F1: ���
��� ?9 SL: 90 F1: ���
���������������������������������������������������������������������������������
���������[���������][?]������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
��������� Quick-Validation Values ���������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
��������� ?0 SL: 5 F1: ���������
��������� ?1 SL: 10 F1: ���������
��������� ?2 SL: 20 F1: ���������
��������� ?3 SL: 30 F1: ���������
��������� ?4 SL: 40 F1: ���������
��������� ?5 SL: 50 F1: ���������
��������� ?6 SL: 60 F1: ���������
��������� ?7 SL: 70 F1: ���������
��������� ?8 SL: 80 F1: ���������
��������� ?9 SL: 90 F1: ���������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
9. Drop file for replying to messages with Synchronet message editors
......
......@@ -5,6 +5,9 @@ Revision History (change log)
=============================
Version Date Description
------- ---- -----------
1.96c 2024-11-20 Bug fix: When showing a poll vote from the user, it should
show people who've voted - ensure it only counts vote
responses
1.96b 2024-11-03 Bug fix: When displaying the new scrollable area change
help window, if there's an area change header in use,
refresh it and the header lines, since the scrollable help
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment