Commit Graph

53 Commits (ab41db22b77a211e89e2b88a63a342f285d79868)

Author SHA1 Message Date
justcool393 ab41db22b7 [DO NOT MERGE] multiple sub banners (#59)
allows multiple sub banners

Snakes note: By request of Carp, especially for WPD.

Co-authored-by: justcool393 <justcool393@gmail.com>
Co-authored-by: Snakes <duolsm@outlook.com>
Reviewed-on: #59
Co-authored-by: justcool393 <justcool393@noreply.fsdfsd.net>
Co-committed-by: justcool393 <justcool393@noreply.fsdfsd.net>
2022-12-11 23:44:34 +00:00
Aevann1 7f4691c79d fix prev commit 2022-12-01 00:33:41 +02:00
Aevann1 e1ed46fa36 rework reddit notifs - testing on pcm lol 2022-12-01 00:29:13 +02:00
justcool393 0ff034b01b add typing to a bunch of routes 2022-11-26 15:00:16 -06:00
Snakes 9eab252e5b
Fix reply/mention notifications from muted users.
Consider the case of the current /notifications filter condition:
    WHERE ... NOT ((comments.sentto = 2) AND (users.is_muted))

SELECT 1 WHERE NOT ((null = 2) AND (true)); ⇒ 0 rows
SELECT 1 WHERE NOT ((1 = 2) AND (true)); ⇒ 1 row
SELECT 1 WHERE NOT ((2 = 2) AND (true)); ⇒ 0 rows

We want the first expression, where comments.sentto = null, to evaluate
to false, not to null, so it negates to true. Behavior as written is:

SELECT 1 WHERE NOT ((null = 2) AND (true)); →
SELECT 1 WHERE NOT (null AND true); →
SELECT 1 WHERE NOT null; →
SELECT 1 WHERE null;

Which guarantees a null return set. If we check first for non-nullity:

SELECT 1 WHERE NOT ((null IS NOT null) AND (null = 2) AND (true)); ⇒ 1
SELECT 1 WHERE NOT ((1 IS NOT null) AND (1 = 2) AND (true)); ⇒ 1
SELECT 1 WHERE NOT ((2 IS NOT null) AND (2 = 2) AND (true)); ⇒ 0
2022-11-21 23:08:31 -05:00
justcool393 255d5b2453 security: fix mute bypass
modmail: constantify user ID
2022-11-17 16:50:06 -06:00
justcool393 a9ebe37e61 sddsdsd 2022-11-15 06:52:17 -06:00
justcool393 3fba55b4ae fix unread 500 2022-11-15 06:51:48 -06:00
justcool393 4b9c702877 fix listing bugs 2022-11-15 03:28:39 -06:00
justcool393 8f2f48d6d1
[DO NOT MERGE] import detanglation (#442)
* move Base definition to files.classes.__init__.py

* fix ImportError

* move userpage listing to users.py

* don't import the app from classes

* consts: set default values to avoid crashes
consts: warn if the secret key is the default config value

* card view: sneed (user db schema)

* cloudflare: use DEFAULT_CONFIG_VALUE

* const: set default values

* decouple media.py from __main__

* pass database to avoid imports

* import cleanup and import request not in const, but in the requests mega import

* move asset_submissions site check to __init__

* asset submissions feature flag

* flag

* g.is_tor

* don't import request where it's not needed

* i think this is fine

* mail: move to own routes and helper

* wrappers

* required wrappers move

* unfuck wrappers a bit

* move snappy quotes and marseys to stateful consts

* marsify

* :pepodrool:

* fix missing import

* import cache

* ...and settings.py

* and static.py

* static needs cache

* route

* lmao all of the jinja shit was in feeds.py amazing

* classes should only import what they need from flask

* import Response

* hdjbjdhbhjf

* ...

* dfdfdfdf

* make get a non-required import

* isort imports (mostly)

* but actually

* configs

* reload config on import

* fgfgfgfg

* config

* config

* initialize snappy and test

* cookie of doom debug

* edfjnkf

* xikscdfd

* debug config

* set session cookie domain, i think this fixes the can't login bug

* sdfbgnhvfdsghbnjfbdvvfghnn

* hrsfxgf

* dump the entire config on a request

* kyskyskyskyskyskyskyskyskys

* duifhdskfjdfd

* dfdfdfdfdfdfdfdfdfdfdfdf

* dfdfdfdf

* imoprt all of the consts beacuse fuck it

* 😭

* dfdfdfdfdfdfsdasdf

* print the entire session

* rffdfdfjkfksj

* fgbhffh

* not the secret keys

* minor bug fixes

* be helpful in the warning

* gfgfgfg

* move warning lower

* isort main imports (i hope this doesn't fuck something up)

* test

* session cookie domain redux

* dfdfdfd

* try only importing Flask

* formkeys fix

* y

* :pepodrool:

* route helper

* remove before flight

* dfdfdfdfdf

* isort classes

* isort helpers

* move check_for_alts to routehelpers and also sort imports and get rid of unused ones

* that previous commit but actkally

* readd the cache in a dozen places they were implicitly imported

* use g.is_tor instead of request.headers. bla bla bla

* upgrade streamers to their own route file

* get rid of unused imports in __main__

* fgfgf

* don't pull in the entire ORM where we don't need it

* features

* explicit imports for the get helper

* explicit imports for the get helper redux

* testing allroutes

* remove unused import

* decouple flask from classes

* syntax fix also remember these have side fx for some reason (why?)

* move side effects out of the class

* posts

* testing on devrama

* settings

* reloading

* settingssdsdsds

* streamer features

* site settings

* testing settings on devrama

* import

* fix modlog

* remove debug stuff

* revert commit 67275b21ab6e2f2520819e84d10bfc1c746a15b6

* archiveorg to _archiveorg

* skhudkfkjfd

* fix cron for PCM

* fix bugs that snekky wants me to

* Fix call to realbody passing db, standardize kwarg

* test

* import check_for_alts from the right place

* cloudflare

* testing on devrama

* fix cron i think

* shadow properly

* tasks

* Remove print which will surely be annoying in prod.

* v and create new session

* use files.classes

* make errors import little and fix rare 500 in /allow_nsfw

* Revert "use files.classes"

This reverts commit 98c10b876cf86ce058b7fb955cf1ec0bfb9996c6.

* pass v to media functions rather than using g

* fix

* dfdfdfdfd

* cleanup, py type checking is dumb so don't use it where it causes issues

* Fix some merge bugs, add DEFAULT_RATELIMIT to main.

* Fix imports on sqlalchemy expressions.

* `from random import random` is an error.

* Fix replies db param.

* errors: fix missing import

* fix rare 500: only send to GIFT_NOTIF_ID if it exists, and send them the right text

* Fix signup formkey.

* fix 2 500s

* propagate db to submissions

* fix replies

* dfdfdfdf

* Fix verifiedcolor.

* is_manual

* can't use getters outside of an app context

* don't attempt to do gumroad on sites where it's not enabled

* don't attempt to do gumraod on sites's where it's unnecessary

* Revert "don't attempt to do gumroad on sites where it's not enabled"

This reverts commit 6f8a6331878655492dfaf1907b27f8be513c14d3.

* fix 500

* validate media type

Co-authored-by: TLSM <duolsm@outlook.com>
2022-11-15 03:19:08 -06:00
Snakes f6dea300b0
Adjust shadowed comment visibility.
- Don't show shadowed comments to non-jannies in notifications.
- Auto-collapse for jannies in notifs/threads.
2022-11-13 17:13:14 -05:00
Snakes 8fee66c894
Reorder decorators to support f63237a9a2.
Ultimately necessary because otherwise all bots share rate limits
with each other. The somewhat haphazard ordering of decorators bothers
me, but it's functionally required.

Approaches using request context (like reading the Authorization
header in ratelimit_user) likely produce bugs all their own.
2022-11-13 05:18:52 -05:00
justcool393 7f36637b54 test 2022-11-13 00:11:56 -06:00
Aevann1 18c7fb365e move the logic for my prev commit to SQLalchemy 2022-11-12 11:24:05 +02:00
Aevann1 9b85fd5dd5 hide modmail messages from muted users in the main notifications tab (they still appear in the modmail tab) 2022-11-12 11:19:56 +02:00
Snakes ebb3957f41
Eager load submission listing relationships. 2022-11-09 09:16:22 -05:00
Aevann1 8b1f76f727 add hole actions notifs for hole mods 2022-11-08 15:49:43 +02:00
justcool393 3a6dfdf2de listings: constantify PAGE_SIZE as 25
magic numbers are bad, do better next time
2022-10-28 22:20:48 -05:00
justcool393 39aa59a37a add g.is_api_or_xhr so we can use it where we want to give API output
* also use v.client for strict API clients
2022-10-15 02:11:36 -07:00
Aevann1 2aa281e8c8 refactor sorting again (untested) 2022-10-12 09:03:28 +02:00
Aevann1 e1ee9a69e4 refactor seeing shadowbanned shit (untested) 2022-10-12 08:24:30 +02:00
justcool393 48384ba8e5 convert a couple of the old constantified permissions to the new system
i don't want to break something so i'm keeping one of them for now but it just links
2022-10-07 01:50:20 -07:00
justcool393 57b08043a4 notification settings and admin setting 2022-10-05 21:40:02 -07:00
justcool393 c2109fd611 modmail viewing perm 2022-10-05 20:10:57 -07:00
justcool393 2fc3044d5b shadowban perms and stuff 2022-10-05 19:24:37 -07:00
Aevann1 4e7510ef64 increase notif count from 10 to 50 2022-10-05 23:11:52 +02:00
Snakes 4a54c6219a
Add trailing final newlines to source files.
Touched a ton of files to finally standardize on having trailing
final newlines, as best practice recommends and so our devs stop
accidentally fighting each other over it.

This was performed automatically with the following:
git ls-files -z '*.py' | while IFS= read -rd '' f; \
    do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
git ls-files -z '*.css' | while IFS= read -rd '' f; \
    do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
2022-09-29 01:43:29 -04:00
Aevann1 13f84a778e change wording 2022-09-24 02:00:43 +02:00
Aevann1 d1e391683b fix unread attribute 2022-09-17 23:59:49 +02:00
Aevann1 09422ebf29 highlight unread DMs in /notifications/messages 2022-09-11 11:06:09 +02:00
Aevann1 327176d31b show most recent replies in /notifications at the top 2022-09-10 11:06:34 +02:00
Aevann1 c1aae95d16 restore "notify followers" checkbox 2022-09-10 09:00:45 +02:00
Snakes ad31fe854b
DMs: add unread indicator, sort by recent reply. 2022-09-09 20:30:56 -04:00
Aevann1 0c32d56cd6 casino + style shit 2022-09-05 01:15:37 +02:00
Aevann1 16626ceb4f reduce max notification depth from 50 to 10 2022-08-15 20:10:45 +02:00
Aevann1 593b74c969 exclude me from modmail notifs in our sites 2022-08-13 01:06:19 +02:00
Aevann1 14a00b5357 fix previous commit 2022-08-06 00:02:41 +02:00
Aevann1 2e3548eb77 remove modmail from my notifs (cancer) 2022-08-05 23:59:40 +02:00
Aevann1 0429da4493 mod action notifs rework 2022-08-05 23:50:30 +02:00
Aevann1 3ecde34fef hide blocked users from post notifs 2022-07-18 01:00:51 +02:00
Aevann1 077353c1f4 hide ghost posts from post notifications 2022-07-12 21:42:23 +02:00
Aevann1 ae45b45bfb refactor json again 2022-07-11 19:33:26 +02:00
Aevann1 bc4074f9aa fix api 500 errors 2022-07-11 19:19:48 +02:00
Aevann1 0b7a5208e9 fix reddit mention bugs 2022-07-10 16:09:41 +02:00
Aevann1 683c9c7bdd fix lingering notifications 2022-07-08 21:42:40 +02:00
Aevann1 f298d134ac make "clear all notifications" button also clear post notifs 2022-07-08 21:33:26 +02:00
Aevann1 65a98cd9fc dont show notifications for posts the user himself makes in a hole they follow 2022-07-08 21:14:04 +02:00
Aevann1 19ee55d27c fix post notifications not being visible 2022-07-08 21:11:56 +02:00
Aevann1 939861e1a0 fix 500 error 2022-07-08 21:10:01 +02:00
Aevann1 a8fe49f232 kitchen sink commit, all over the place 2022-07-08 21:03:04 +02:00