* For the Direct Message History database, use gorm.io as ORM so that Postgres
can be used instead of SQLite for bigger chat room instances.
* In settings.toml: the new DatabaseType field defaults to 'sqlite3' but can be
set to 'postgres' and use the credentials in the new PostgresDatabase field.
* The DirectMessage table schema is also updated to deprecate the Timestamp int
field in favor of a proper CreatedAt datetime field. Existing SQLite instances
will upgrade their table in the background, converting Timestamp to CreatedAt
and blanking out the legacy Timestamp column.
* Fix some DB queries so when paginating your DMs history username list, sorting
it by timestamp now works reliably.
* For existing SQLite instances that want to switch to Postgres, use the
scripts/sqlite2psql.py script to transfer your database over.
The ORDER BY timestamp on the DMs Username History endpoint was causing
SQLite to do a full table scan by timestamp instead of indexing on
channel ID. So, instead, we fetch the distinct channel IDs for the
current user and add them to an IN clause on the main query (instead of
a LIKE clause), which causes the index to use the channel_id instead of
timestamp. This may improve CPU performance and speed on this endpoint.
* Add a History button under the DMs where an authenticated JWT user can page
through the usernames they have stored history with, to bring up those DMs
even if their chat partner is not currently online.
* Try some fixes to the dark video detector to see if it reduces false
positives: wait for the canplaythrough video event to fire before beginning
the dark detection. Also, increase the threshold so dark frames need to be
seen 5 times in a row instead of twice before cutting the camera.
* Add support for storing DM history between users in a SQLite3 database.
* Opt-in by editing your settings.toml to set DirectMessageHistory/Enabled=true
* Retention days (default 90) will flush old DMs on app startup.
* On the front-end, DM history is checked when a DM thread is opened.