guild icon indicating copy to clipboard operation
guild copied to clipboard

Feature Addition: Account Linker/Switcher && Bugfix: Enable staff to see hidden threads

Open LegendBegins opened this issue 2 years ago • 2 comments

Hiding a thread is no longer permanent, preventing 1-click errors (as appears to be the original intent).

Remaining TODO: Threads still show up on the homepage in the Latest section after deletion. If mods wipe a thread, that should trigger an update.

LegendBegins avatar Jun 05 '23 04:06 LegendBegins

Major caveat: This commit requires an addition to the DB schema. Specifically, a two-column table for account alts and pre-populating that table with all user accounts. The two queries I added to schema and dev_seeds should get everything set up. Reproduced below for clarity:

CREATE TABLE alts ( id SERIAL PRIMARY KEY, ownerId SERIAL NOT NULL );

INSERT INTO alts (id, ownerId) SELECT id, id FROM users;

Additional notes: I did some onclick JS in macros.html to support the dropdown menu, and left it inline since it was pretty much a one-liner. If you want me to break it into its own function in the JS file, let me know and I'll modify it.

There's a lot of code to verify here, so feel free to ping me on Discord with any questions—I think most of it should be pretty straightforward.

I do need to double check that the alts table is updated on registration. The query was super simple and seemed to work when I pasted it into Postgres, but since I haven't messed around with the test environment to get CAPTCHAs working (or bypass the requirement) I wasn't able to verify that one piece of functionality within the environment context.

LegendBegins avatar Jun 12 '23 02:06 LegendBegins