Fossil SCM

The post sequence numbers on the hierarchical display of a forum thread should be the sequence number of the original version of the post, not the final edit of the post.

drh 2020-04-22 18:01 trunk
Commit c6890fd46a42cca6512858b7dac54d3f56e0c264d55a56845c75902f4899736d
1 file changed +5 -3
+5 -3
--- src/forum.c
+++ src/forum.c
@@ -417,10 +417,11 @@
417417
Manifest *pPost;
418418
int isPrivate; /* True for posts awaiting moderation */
419419
int sameUser; /* True if author is also the reader */
420420
const char *zUuid;
421421
char *zDisplayName; /* The display name */
422
+ int sid;
422423
423424
pPost = manifest_get(p->fpid, CFTYPE_FORUM, 0);
424425
if( pPost==0 ) continue;
425426
if( p->fpid==target ){
426427
@ <div id="forum%d(p->fpid)" class="forumTime forumSel">
@@ -432,11 +433,12 @@
432433
if( pPost->zThreadTitle ){
433434
@ <h1>%h(pPost->zThreadTitle)</h1>
434435
}
435436
zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate);
436437
zDisplayName = display_name_from_login(pPost->zUser);
437
- @ <h3 class='forumPostHdr'>(%d(p->sid)) By %h(zDisplayName) on %h(zDate)
438
+ sid = p->pEdit ? p->pEdit->sid : p->sid;
439
+ @ <h3 class='forumPostHdr'>(%d(sid)) By %h(zDisplayName) on %h(zDate)
438440
fossil_free(zDisplayName);
439441
fossil_free(zDate);
440442
if( p->pEdit ){
441443
@ edit of %z(href("%R/forumpost/%S?t=%c",p->pEdit->zUuid,cMode))\
442444
@ %d(p->pEdit->sid)</a>
@@ -673,11 +675,11 @@
673675
@ <h1>%h(pPost->zThreadTitle)</h1>
674676
}
675677
zDate = db_text(0, "SELECT datetime(%.17g)", pOPost->rDate);
676678
zDisplayName = display_name_from_login(pOPost->zUser);
677679
@ <h3 class='forumPostHdr'>\
678
- @ (%d(p->pLeaf?p->pLeaf->sid:p->sid)) By %h(zDisplayName) on %h(zDate)
680
+ @ (%d(p->sid)) By %h(zDisplayName) on %h(zDate)
679681
fossil_free(zDisplayName);
680682
fossil_free(zDate);
681683
if( g.perm.Debug ){
682684
@ <span class="debug">\
683685
@ <a href="%R/artifact/%h(p->zUuid)">(artifact-%d(p->fpid))</a></span>
@@ -702,11 +704,11 @@
702704
@ %z(href("%R/forumpost/%S",zUuid))[link]</a>
703705
}
704706
@ %z(href("%R/forumpost/%S?raw",zUuid))[source]</a>
705707
if( p->firt ){
706708
ForumEntry *pIrt = p->pPrev;
707
- while( pIrt && pIrt->fpid!=p->firt ) pIrt = pIrt->pPrev;
709
+ while( pIrt && pIrt->fpid!=p->mfirt ) pIrt = pIrt->pPrev;
708710
if( pIrt ){
709711
@ in reply to %z(href("%R/forumpost/%S?t=h",pIrt->zUuid))\
710712
@ %d(pIrt->sid)</a>
711713
}
712714
}
713715
--- src/forum.c
+++ src/forum.c
@@ -417,10 +417,11 @@
417 Manifest *pPost;
418 int isPrivate; /* True for posts awaiting moderation */
419 int sameUser; /* True if author is also the reader */
420 const char *zUuid;
421 char *zDisplayName; /* The display name */
 
422
423 pPost = manifest_get(p->fpid, CFTYPE_FORUM, 0);
424 if( pPost==0 ) continue;
425 if( p->fpid==target ){
426 @ <div id="forum%d(p->fpid)" class="forumTime forumSel">
@@ -432,11 +433,12 @@
432 if( pPost->zThreadTitle ){
433 @ <h1>%h(pPost->zThreadTitle)</h1>
434 }
435 zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate);
436 zDisplayName = display_name_from_login(pPost->zUser);
437 @ <h3 class='forumPostHdr'>(%d(p->sid)) By %h(zDisplayName) on %h(zDate)
 
438 fossil_free(zDisplayName);
439 fossil_free(zDate);
440 if( p->pEdit ){
441 @ edit of %z(href("%R/forumpost/%S?t=%c",p->pEdit->zUuid,cMode))\
442 @ %d(p->pEdit->sid)</a>
@@ -673,11 +675,11 @@
673 @ <h1>%h(pPost->zThreadTitle)</h1>
674 }
675 zDate = db_text(0, "SELECT datetime(%.17g)", pOPost->rDate);
676 zDisplayName = display_name_from_login(pOPost->zUser);
677 @ <h3 class='forumPostHdr'>\
678 @ (%d(p->pLeaf?p->pLeaf->sid:p->sid)) By %h(zDisplayName) on %h(zDate)
679 fossil_free(zDisplayName);
680 fossil_free(zDate);
681 if( g.perm.Debug ){
682 @ <span class="debug">\
683 @ <a href="%R/artifact/%h(p->zUuid)">(artifact-%d(p->fpid))</a></span>
@@ -702,11 +704,11 @@
702 @ %z(href("%R/forumpost/%S",zUuid))[link]</a>
703 }
704 @ %z(href("%R/forumpost/%S?raw",zUuid))[source]</a>
705 if( p->firt ){
706 ForumEntry *pIrt = p->pPrev;
707 while( pIrt && pIrt->fpid!=p->firt ) pIrt = pIrt->pPrev;
708 if( pIrt ){
709 @ in reply to %z(href("%R/forumpost/%S?t=h",pIrt->zUuid))\
710 @ %d(pIrt->sid)</a>
711 }
712 }
713
--- src/forum.c
+++ src/forum.c
@@ -417,10 +417,11 @@
417 Manifest *pPost;
418 int isPrivate; /* True for posts awaiting moderation */
419 int sameUser; /* True if author is also the reader */
420 const char *zUuid;
421 char *zDisplayName; /* The display name */
422 int sid;
423
424 pPost = manifest_get(p->fpid, CFTYPE_FORUM, 0);
425 if( pPost==0 ) continue;
426 if( p->fpid==target ){
427 @ <div id="forum%d(p->fpid)" class="forumTime forumSel">
@@ -432,11 +433,12 @@
433 if( pPost->zThreadTitle ){
434 @ <h1>%h(pPost->zThreadTitle)</h1>
435 }
436 zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate);
437 zDisplayName = display_name_from_login(pPost->zUser);
438 sid = p->pEdit ? p->pEdit->sid : p->sid;
439 @ <h3 class='forumPostHdr'>(%d(sid)) By %h(zDisplayName) on %h(zDate)
440 fossil_free(zDisplayName);
441 fossil_free(zDate);
442 if( p->pEdit ){
443 @ edit of %z(href("%R/forumpost/%S?t=%c",p->pEdit->zUuid,cMode))\
444 @ %d(p->pEdit->sid)</a>
@@ -673,11 +675,11 @@
675 @ <h1>%h(pPost->zThreadTitle)</h1>
676 }
677 zDate = db_text(0, "SELECT datetime(%.17g)", pOPost->rDate);
678 zDisplayName = display_name_from_login(pOPost->zUser);
679 @ <h3 class='forumPostHdr'>\
680 @ (%d(p->sid)) By %h(zDisplayName) on %h(zDate)
681 fossil_free(zDisplayName);
682 fossil_free(zDate);
683 if( g.perm.Debug ){
684 @ <span class="debug">\
685 @ <a href="%R/artifact/%h(p->zUuid)">(artifact-%d(p->fpid))</a></span>
@@ -702,11 +704,11 @@
704 @ %z(href("%R/forumpost/%S",zUuid))[link]</a>
705 }
706 @ %z(href("%R/forumpost/%S?raw",zUuid))[source]</a>
707 if( p->firt ){
708 ForumEntry *pIrt = p->pPrev;
709 while( pIrt && pIrt->fpid!=p->mfirt ) pIrt = pIrt->pPrev;
710 if( pIrt ){
711 @ in reply to %z(href("%R/forumpost/%S?t=h",pIrt->zUuid))\
712 @ %d(pIrt->sid)</a>
713 }
714 }
715

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button