Fossil SCM
Add a notice to the forum post editor politely requesting that users refrain from making multiple posts or edits in rapid succession to avoid spamming subscribers. Prompted by recent sqlite forum activity. A more complete solution would include a toggle to hide this notice and remember that preference via sessionStorage.
Commit
6eeeed8b9f64dc54f61e9fbd0136acbc69a69f42d6bff4b08ad37ecda59fbb07
Parent
1cf64a94569ddd5…
1 file changed
+13
+13
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -1554,10 +1554,21 @@ | ||
| 1554 | 1554 | @ <br><label><input type="checkbox" name="fpsilent" %s(PCK("fpsilent"))> \ |
| 1555 | 1555 | @ Do not send notification emails</label> |
| 1556 | 1556 | @ </div> |
| 1557 | 1557 | } |
| 1558 | 1558 | } |
| 1559 | + | |
| 1560 | +static void forum_render_notification_reminder(void){ | |
| 1561 | + if( alert_tables_exist() ){ | |
| 1562 | + @ <div class='debug'>Creating and editing forum posts may send notifications | |
| 1563 | + @ to an arbitrary number of subscribers. To reduce subscriber annoyance and | |
| 1564 | + @ the risk of this forum's messages being flagged as spam by mail providers, | |
| 1565 | + @ <em>please refrain from making multiple new posts or edits in rapid | |
| 1566 | + @ succession</em>. | |
| 1567 | + @ </div> | |
| 1568 | + } | |
| 1569 | +} | |
| 1559 | 1570 | |
| 1560 | 1571 | /* |
| 1561 | 1572 | ** WEBPAGE: forume1 |
| 1562 | 1573 | ** |
| 1563 | 1574 | ** Start a new forum thread. |
| @@ -1584,10 +1595,11 @@ | ||
| 1584 | 1595 | style_header("New Forum Thread"); |
| 1585 | 1596 | @ <form action="%R/forume1" method="POST"> |
| 1586 | 1597 | @ <h1>New Thread:</h1> |
| 1587 | 1598 | forum_from_line(); |
| 1588 | 1599 | forum_post_widget(zTitle, zMimetype, zContent); |
| 1600 | + forum_render_notification_reminder(); | |
| 1589 | 1601 | @ <input type="submit" name="preview" value="Preview"> |
| 1590 | 1602 | if( P("preview") && !whitespace_only(zContent) ){ |
| 1591 | 1603 | @ <input type="submit" name="submit" value="Submit"> |
| 1592 | 1604 | }else{ |
| 1593 | 1605 | @ <input type="submit" name="submit" value="Submit" disabled> |
| @@ -1775,10 +1787,11 @@ | ||
| 1775 | 1787 | @ <input type="hidden" name="reply" value="1"> |
| 1776 | 1788 | forum_from_line(); |
| 1777 | 1789 | forum_post_widget(0, zMimetype, zContent); |
| 1778 | 1790 | } |
| 1779 | 1791 | if( !isDelete ){ |
| 1792 | + forum_render_notification_reminder(); | |
| 1780 | 1793 | @ <input type="submit" name="preview" value="Preview"> |
| 1781 | 1794 | } |
| 1782 | 1795 | @ <input type="submit" name="cancel" value="Cancel"> |
| 1783 | 1796 | if( (bPreview && !whitespace_only(zContent)) || isDelete ){ |
| 1784 | 1797 | if( !iClosed || g.perm.Admin ) { |
| 1785 | 1798 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -1554,10 +1554,21 @@ | |
| 1554 | @ <br><label><input type="checkbox" name="fpsilent" %s(PCK("fpsilent"))> \ |
| 1555 | @ Do not send notification emails</label> |
| 1556 | @ </div> |
| 1557 | } |
| 1558 | } |
| 1559 | |
| 1560 | /* |
| 1561 | ** WEBPAGE: forume1 |
| 1562 | ** |
| 1563 | ** Start a new forum thread. |
| @@ -1584,10 +1595,11 @@ | |
| 1584 | style_header("New Forum Thread"); |
| 1585 | @ <form action="%R/forume1" method="POST"> |
| 1586 | @ <h1>New Thread:</h1> |
| 1587 | forum_from_line(); |
| 1588 | forum_post_widget(zTitle, zMimetype, zContent); |
| 1589 | @ <input type="submit" name="preview" value="Preview"> |
| 1590 | if( P("preview") && !whitespace_only(zContent) ){ |
| 1591 | @ <input type="submit" name="submit" value="Submit"> |
| 1592 | }else{ |
| 1593 | @ <input type="submit" name="submit" value="Submit" disabled> |
| @@ -1775,10 +1787,11 @@ | |
| 1775 | @ <input type="hidden" name="reply" value="1"> |
| 1776 | forum_from_line(); |
| 1777 | forum_post_widget(0, zMimetype, zContent); |
| 1778 | } |
| 1779 | if( !isDelete ){ |
| 1780 | @ <input type="submit" name="preview" value="Preview"> |
| 1781 | } |
| 1782 | @ <input type="submit" name="cancel" value="Cancel"> |
| 1783 | if( (bPreview && !whitespace_only(zContent)) || isDelete ){ |
| 1784 | if( !iClosed || g.perm.Admin ) { |
| 1785 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -1554,10 +1554,21 @@ | |
| 1554 | @ <br><label><input type="checkbox" name="fpsilent" %s(PCK("fpsilent"))> \ |
| 1555 | @ Do not send notification emails</label> |
| 1556 | @ </div> |
| 1557 | } |
| 1558 | } |
| 1559 | |
| 1560 | static void forum_render_notification_reminder(void){ |
| 1561 | if( alert_tables_exist() ){ |
| 1562 | @ <div class='debug'>Creating and editing forum posts may send notifications |
| 1563 | @ to an arbitrary number of subscribers. To reduce subscriber annoyance and |
| 1564 | @ the risk of this forum's messages being flagged as spam by mail providers, |
| 1565 | @ <em>please refrain from making multiple new posts or edits in rapid |
| 1566 | @ succession</em>. |
| 1567 | @ </div> |
| 1568 | } |
| 1569 | } |
| 1570 | |
| 1571 | /* |
| 1572 | ** WEBPAGE: forume1 |
| 1573 | ** |
| 1574 | ** Start a new forum thread. |
| @@ -1584,10 +1595,11 @@ | |
| 1595 | style_header("New Forum Thread"); |
| 1596 | @ <form action="%R/forume1" method="POST"> |
| 1597 | @ <h1>New Thread:</h1> |
| 1598 | forum_from_line(); |
| 1599 | forum_post_widget(zTitle, zMimetype, zContent); |
| 1600 | forum_render_notification_reminder(); |
| 1601 | @ <input type="submit" name="preview" value="Preview"> |
| 1602 | if( P("preview") && !whitespace_only(zContent) ){ |
| 1603 | @ <input type="submit" name="submit" value="Submit"> |
| 1604 | }else{ |
| 1605 | @ <input type="submit" name="submit" value="Submit" disabled> |
| @@ -1775,10 +1787,11 @@ | |
| 1787 | @ <input type="hidden" name="reply" value="1"> |
| 1788 | forum_from_line(); |
| 1789 | forum_post_widget(0, zMimetype, zContent); |
| 1790 | } |
| 1791 | if( !isDelete ){ |
| 1792 | forum_render_notification_reminder(); |
| 1793 | @ <input type="submit" name="preview" value="Preview"> |
| 1794 | } |
| 1795 | @ <input type="submit" name="cancel" value="Cancel"> |
| 1796 | if( (bPreview && !whitespace_only(zContent)) || isDelete ){ |
| 1797 | if( !iClosed || g.perm.Admin ) { |
| 1798 |