Skip to content
Snippets Groups Projects
Commit 082a9fce authored by rswindell's avatar rswindell
Browse files

sbbs_t::listmsgs() is called from both readmsgs() and listsub(), where the

message numbers should be printed differently for each context, so added a
'reading' boolean argument (defaults to true) to indicate it was called from
readmsgs() and to use the index offset (+1) as the printed msg number in that
case.
parent 6a52d870
Branches
Tags
No related merge requests found
......@@ -59,7 +59,7 @@ uchar sbbs_t::msg_listing_flag(uint subnum, smbmsg_t* msg, post_t* post)
return ' ';
}
long sbbs_t::listmsgs(uint subnum, long mode, post_t *post, long i, long posts)
long sbbs_t::listmsgs(uint subnum, long mode, post_t *post, long i, long posts, bool reading)
{
smbmsg_t msg;
long listed=0;
......@@ -73,7 +73,7 @@ long sbbs_t::listmsgs(uint subnum, long mode, post_t *post, long i, long posts)
smb_unlockmsghdr(&smb,&msg);
if(listed==0)
bputs(text[MailOnSystemLstHdr]);
bprintf(text[SubMsgLstFmt], i+1
bprintf(text[SubMsgLstFmt], reading ? (i+1) : post[i].num
,msg.hdr.attr&MSG_ANONYMOUS && !sub_op(subnum)
? text[Anonymous] : msg.from
,msg.to
......@@ -1726,7 +1726,7 @@ long sbbs_t::listsub(uint subnum, long mode, long start, const char* search)
if(mode&SCAN_FIND)
displayed=searchposts(subnum, post, start, posts, search);
else
displayed=listmsgs(subnum, mode, post, start, posts);
displayed=listmsgs(subnum, mode, post, start, posts, /* reading: */false);
free(post);
}
smb_close(&smb);
......
......@@ -803,7 +803,7 @@ public:
int scanposts(uint subnum, long mode, const char* find); /* Scan sub-board */
bool scanposts_inside;
long listsub(uint subnum, long mode, long start, const char* search);
long listmsgs(uint subnum, long mode, post_t* post, long start, long posts);
long listmsgs(uint subnum, long mode, post_t* post, long start, long posts, bool reading = true);
long searchposts(uint subnum, post_t* post, long start, long msgs, const char* find);
long showposts_toyou(uint subnum, post_t* post, ulong start, long posts, long mode=0);
void show_thread(uint32_t msgnum, post_t* post, unsigned curmsg, int thread_depth = 0, uint64_t reply_mask = 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment