* Added isSticky field to `Thread` and in the sql query making a Thread
- Modified indices in `data` and `selectUser` to support `isSticky`
- Add backend procs for initial sticky logic, modeled after locking threads
- Fix indices in selectThread
- Fixup posts.json's threadquery to match Thread with sticky field
* Implement StickyButton for postbutton.nim and add it to postlist.nim
* Fix sticky routes
* Order sticky in a way that they actually appear at the top
* Add border for isSticky on genThread
* Rename stickies to pinned, so professional!
* Add pinned tests
- Add an id to pin button, and add first attempt at useful tests
- Improve pin tests, refactored it into adminTests and userTests
- Add an id to pin button, and add first attempt at useful tests
- Improve pin tests, refactored it into adminTests and userTests
* Make tests more reliable
Co-authored-by: Joey Yakimowich-Payne <jyapayne@gmail.com>
Other forums usually have allowed editing times measured in
*minutes*, we had it in weeks.
Two hours should be plenty of time to edit a post, but more importantly
it should prevent spamming mis-usages that sometimes happened before:
You read a perfectly normal post (usually copy-pasted from somewhere)
and then much later on (when most of us regular forum users don't notice
anymore because we frequently read new threads/posts) it is edited to
contain spammy links and content.
Admins must be able to always edit a post, no matter of its age.
This will fix https://github.com/nim-lang/nimforum/issues/155.
Currently nimforum sends the confirmation email to the address in
database but it should've sent it to the new address.
Activity: User changes email
Issue: Confirmation email is sent to old address
Fix: Send the confirmation email to updated address
UTC time is used because we cannot format time as "Fri, 22 May 2020
06:33:00 +0000" with the times package.
"zz" returns +00 & "zzz" returns +00:00, note that the former doesn't
return minutes value so it'll return +05 for systems in timezone
+0530 & "zzz" will return +05:30 for the same.
Instead of parsing it again & removing ':' manually we use UTC time &
add "+0000".