Commit 5b310552 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Update getlastmsg() to return total messages, excluding votes & poll-closures.

The return value of getlastmsg() is displayed as the total messages in a
sub-board when scanning subs. For sub-boards that allow voting, use the new
smb_msg_count() function to determine the number of displayable messages.
parent 7c12761d
Pipeline #248 passed with stage
in 17 minutes and 35 seconds
......@@ -645,7 +645,10 @@ ulong sbbs_t::getlastmsg(uint subnum, uint32_t *ptr, time_t *t)
errormsg(WHERE,ERR_READ,smb.file,i,smb.last_error);
return(0);
}
total=(long)filelength(fileno(smb.sid_fp))/sizeof(idxrec_t);
if(cfg.sub[subnum]->misc & SUB_NOVOTING)
total = (long)filelength(fileno(smb.sid_fp))/sizeof(idxrec_t);
else
total = smb_msg_count(&smb, (1 << SMB_MSG_TYPE_NORMAL) | (1 << SMB_MSG_TYPE_POLL));
smb_unlocksmbhdr(&smb);
smb_close(&smb);
if(ptr)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment