* Integrate chat from upstream
Substantially borrowed from upstream ref: 13a208ee88e55 (before they
started editing generated artefacts instead of source).
Integrated, including:
- Remove previously removed features: emoji, hats, and name colors
- Compensate for lack of unified root template
- Add React build process to Dockerfile and `bootstrap/init.sh`
- Preliminary integration of chat websocket workers
For testing, modify `supervisord.conf.dev` to put chat on port 80 and
the site service on some other port. Then visit: http://localhost/chat
Still to do:
- Access control for specific small-groups (and admins probably):
Set the values somewhere (site_settings.json? Redis?) and use for
authorization in `chat_is_allowed`.
- Proxying only /chat to the websocket workers
- Chat persistance across restarts: either Redis devops or to DB
* Add nginx server to do appropriate redirection.
* Add necessary columns to User.
* Wire up chat permissions.
* Reload chat on source change.
* Add a better structure for slash commands and add/remove functionality.
* Stop putting up previews of slash commands.
* We require more whitespace.
* Strip DMs out entirely, I currently do not want to deal with them.
* Change "Users Online" to just "Users".
* Clean up a little more DM detritus.
* Save chat history in database.
* Remove unnecessary hefty query to the DB.
* Clean up optimistic messages.
* Initial implementation of notification icon.
* Update readme a little bit.
* Fix notification highlight (mostly).
* Remove chat version number that will never be updated.
* Fix: Errors on logged-out users.
* Add function to nuke the chat state.
* Update DB.
* Add a dedicated deployable docker image.
* Fix: init_build.sh execute bit not set.
* Whoops, screwed up the abort() call.
* Relax chat rate limiter.
* Remove a somewhat silly comment.
* Remove an unnecessary g.db.add().
---------
Co-authored-by: TLSM <duolsm@outlook.com>
it's kinda hard to give a good description but this fixes a bug where
the raw HTML of a post's content (not mediated by `realbody`) is being
sent to the `submission_banned.html` template. it also fixes the
formatting.
Handle a couple places with `t3_` that persisted from code movement.
on master after time of branch.
Then, fix commenting, which used inaccurate fullname parsing logic.
because of #606, we now have a relatively decent way of representing
how post/comment state is in the database. we'll use this in our code
which is used to determine what is shown in the UI
The notifications schema is already set up for reddit-style
chronological notifications. We simply have to remove the logic that
builds the context and patch up a few places in the frontend that
were expecting full reply trees.
`Comment.header_msg` previously expected the user's own comment to
be top-level in comment replies. Logic is revised to expect the actual
reply.
`files.routes.front.notifications_main` now has reduced query volume
because we aren't expiring the session when marking notifications read.
This also allows us to remove the unused `comms` variable, which is a
makeshift "pattern" of storing duplicate database replies across a
commit so the templates don't requery (thus losing data attached to
the runtime object, like `c.unread` / `c.notif_utc`).
We move the `is_notification_page` flag to the route callers rather
than templates checking `request.path`.
Minor UI style: "Clear all notifications" -> "Mark All Read", since
this was a persistent point of user confusion upstream, with people
expecting their inbox to empty out. Also less margin between notifs
to be consistent with tighter comment display elsewhere and removed
need to separate groups of comments vs single comments.
Change the notifications subpages to be distinct route handlers with
actual paths rather than query parameters. They already were a massive
conditional chain with almost no common logic.
Hard wrap some of the more egregious query lines. Use less duplicated
code for shadowban exclusion.
Only major functionality change which is somewhat related to #476 is
to sort subtrees by Comment.id DESC. Otherwise, upstream is
substantially the same as TheMotte. Given that upstream didn't
experience #476, I think the issue may have been resolved by prior
changes to filtering / comment visibility & moderation.
In the distant past, the codebase would check pushshift for keyword
mentions and generate notifications to admins about them. I can't
find where we removed it, but I don't think it was ever operative.
Since these notifications don't get generated, we don't need a
notifications page for them.