Fossil SCM
Enable deltification of edits of forum posts, limited to those which do not require moderation. Seems to work but requires more testing.
Commit
a612aa73889b96dedd04a3c14b25560d52efb775a15c1b8229eb25e767083d65
Parent
45953a4ad0c1581…
2 files changed
+1
-1
+3
-1
+1
-1
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -786,11 +786,11 @@ | ||
| 786 | 786 | ** artifact. Otherwise, when we go to send the public artifact on a |
| 787 | 787 | ** sync operation, the other end of the sync will never be able to receive |
| 788 | 788 | ** the source of the delta. It is OK to delta private->private and |
| 789 | 789 | ** public->private and public->public. Just no private->public delta. |
| 790 | 790 | ** |
| 791 | -** If aSrc[bestSrc] is already a dleta that depends on rid, then it is | |
| 791 | +** If aSrc[bestSrc] is already a delta that depends on rid, then it is | |
| 792 | 792 | ** converted to undeltaed text before the aSrc[bestSrc]->rid delta is |
| 793 | 793 | ** created, in order to prevent a delta loop. |
| 794 | 794 | ** |
| 795 | 795 | ** If either rid or aSrc[i] contain less than 50 bytes, or if the |
| 796 | 796 | ** resulting delta does not achieve a compression of at least 25% |
| 797 | 797 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -786,11 +786,11 @@ | |
| 786 | ** artifact. Otherwise, when we go to send the public artifact on a |
| 787 | ** sync operation, the other end of the sync will never be able to receive |
| 788 | ** the source of the delta. It is OK to delta private->private and |
| 789 | ** public->private and public->public. Just no private->public delta. |
| 790 | ** |
| 791 | ** If aSrc[bestSrc] is already a dleta that depends on rid, then it is |
| 792 | ** converted to undeltaed text before the aSrc[bestSrc]->rid delta is |
| 793 | ** created, in order to prevent a delta loop. |
| 794 | ** |
| 795 | ** If either rid or aSrc[i] contain less than 50 bytes, or if the |
| 796 | ** resulting delta does not achieve a compression of at least 25% |
| 797 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -786,11 +786,11 @@ | |
| 786 | ** artifact. Otherwise, when we go to send the public artifact on a |
| 787 | ** sync operation, the other end of the sync will never be able to receive |
| 788 | ** the source of the delta. It is OK to delta private->private and |
| 789 | ** public->private and public->public. Just no private->public delta. |
| 790 | ** |
| 791 | ** If aSrc[bestSrc] is already a delta that depends on rid, then it is |
| 792 | ** converted to undeltaed text before the aSrc[bestSrc]->rid delta is |
| 793 | ** created, in order to prevent a delta loop. |
| 794 | ** |
| 795 | ** If either rid or aSrc[i] contain less than 50 bytes, or if the |
| 796 | ** resulting delta does not achieve a compression of at least 25% |
| 797 |
+3
-1
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -684,11 +684,13 @@ | ||
| 684 | 684 | @ <pre>%h(blob_str(&x))</pre> |
| 685 | 685 | @ </div> |
| 686 | 686 | blob_reset(&x); |
| 687 | 687 | return 0; |
| 688 | 688 | }else{ |
| 689 | - int nrid = wiki_put(&x, 0, forum_need_moderation()); | |
| 689 | + int nrid = wiki_put(&x, iEdit>0 ? iEdit : 0, | |
| 690 | + forum_need_moderation()); | |
| 691 | + blob_reset(&x); | |
| 690 | 692 | cgi_redirectf("%R/forumpost/%S", rid_to_uuid(nrid)); |
| 691 | 693 | return 1; |
| 692 | 694 | } |
| 693 | 695 | } |
| 694 | 696 | |
| 695 | 697 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -684,11 +684,13 @@ | |
| 684 | @ <pre>%h(blob_str(&x))</pre> |
| 685 | @ </div> |
| 686 | blob_reset(&x); |
| 687 | return 0; |
| 688 | }else{ |
| 689 | int nrid = wiki_put(&x, 0, forum_need_moderation()); |
| 690 | cgi_redirectf("%R/forumpost/%S", rid_to_uuid(nrid)); |
| 691 | return 1; |
| 692 | } |
| 693 | } |
| 694 | |
| 695 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -684,11 +684,13 @@ | |
| 684 | @ <pre>%h(blob_str(&x))</pre> |
| 685 | @ </div> |
| 686 | blob_reset(&x); |
| 687 | return 0; |
| 688 | }else{ |
| 689 | int nrid = wiki_put(&x, iEdit>0 ? iEdit : 0, |
| 690 | forum_need_moderation()); |
| 691 | blob_reset(&x); |
| 692 | cgi_redirectf("%R/forumpost/%S", rid_to_uuid(nrid)); |
| 693 | return 1; |
| 694 | } |
| 695 | } |
| 696 | |
| 697 |