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.
Commit
c6890fd46a42cca6512858b7dac54d3f56e0c264d55a56845c75902f4899736d
Parent
fb4545ef937e06e…
1 file changed
+5
-3
+5
-3
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -417,10 +417,11 @@ | ||
| 417 | 417 | Manifest *pPost; |
| 418 | 418 | int isPrivate; /* True for posts awaiting moderation */ |
| 419 | 419 | int sameUser; /* True if author is also the reader */ |
| 420 | 420 | const char *zUuid; |
| 421 | 421 | char *zDisplayName; /* The display name */ |
| 422 | + int sid; | |
| 422 | 423 | |
| 423 | 424 | pPost = manifest_get(p->fpid, CFTYPE_FORUM, 0); |
| 424 | 425 | if( pPost==0 ) continue; |
| 425 | 426 | if( p->fpid==target ){ |
| 426 | 427 | @ <div id="forum%d(p->fpid)" class="forumTime forumSel"> |
| @@ -432,11 +433,12 @@ | ||
| 432 | 433 | if( pPost->zThreadTitle ){ |
| 433 | 434 | @ <h1>%h(pPost->zThreadTitle)</h1> |
| 434 | 435 | } |
| 435 | 436 | zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate); |
| 436 | 437 | 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) | |
| 438 | 440 | fossil_free(zDisplayName); |
| 439 | 441 | fossil_free(zDate); |
| 440 | 442 | if( p->pEdit ){ |
| 441 | 443 | @ edit of %z(href("%R/forumpost/%S?t=%c",p->pEdit->zUuid,cMode))\ |
| 442 | 444 | @ %d(p->pEdit->sid)</a> |
| @@ -673,11 +675,11 @@ | ||
| 673 | 675 | @ <h1>%h(pPost->zThreadTitle)</h1> |
| 674 | 676 | } |
| 675 | 677 | zDate = db_text(0, "SELECT datetime(%.17g)", pOPost->rDate); |
| 676 | 678 | zDisplayName = display_name_from_login(pOPost->zUser); |
| 677 | 679 | @ <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) | |
| 679 | 681 | fossil_free(zDisplayName); |
| 680 | 682 | fossil_free(zDate); |
| 681 | 683 | if( g.perm.Debug ){ |
| 682 | 684 | @ <span class="debug">\ |
| 683 | 685 | @ <a href="%R/artifact/%h(p->zUuid)">(artifact-%d(p->fpid))</a></span> |
| @@ -702,11 +704,11 @@ | ||
| 702 | 704 | @ %z(href("%R/forumpost/%S",zUuid))[link]</a> |
| 703 | 705 | } |
| 704 | 706 | @ %z(href("%R/forumpost/%S?raw",zUuid))[source]</a> |
| 705 | 707 | if( p->firt ){ |
| 706 | 708 | ForumEntry *pIrt = p->pPrev; |
| 707 | - while( pIrt && pIrt->fpid!=p->firt ) pIrt = pIrt->pPrev; | |
| 709 | + while( pIrt && pIrt->fpid!=p->mfirt ) pIrt = pIrt->pPrev; | |
| 708 | 710 | if( pIrt ){ |
| 709 | 711 | @ in reply to %z(href("%R/forumpost/%S?t=h",pIrt->zUuid))\ |
| 710 | 712 | @ %d(pIrt->sid)</a> |
| 711 | 713 | } |
| 712 | 714 | } |
| 713 | 715 |
| --- 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 |