Commit Graph

721 Commits (2183161916a141f192377897bf4ee2d92effc941)

Author SHA1 Message Date
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 272e2ee936
sneed (rename procoins to marseybux) (#472)
* sneed (rename procoins to marseybux)

* literally unusable

Co-authored-by: TLSM <duolsm@outlook.com>
2022-11-21 18:08:29 -05:00
Aevann1 2f31fdfdd7 Revert "remove User.newtab and see if anyone complains"
This reverts commit 787c89961f.
2022-11-21 18:55:13 +02:00
Aevann1 787c89961f remove User.newtab and see if anyone complains 2022-11-21 16:36:17 +02:00
Aevann1 ddf2a3cf51 make new-user hat be 7 days 2022-11-20 00:48:24 +02:00
gooseman dcbacc6d04 newfriend hat :)) 2022-11-19 14:18:13 -08:00
Aevann1 5288d7a7dc remove android app and replace with instructions on how to install PWA 2022-11-20 00:04:08 +02:00
Aevann1 37104be217 add exclusive android app posts 2022-11-19 23:22:03 +02:00
Aevann1 9e457165fa make me and sneks mod all holes 2022-11-19 20:24:02 +02:00
justcool393 255d5b2453 security: fix mute bypass
modmail: constantify user ID
2022-11-17 16:50:06 -06:00
justcool393 12881388d6 notifications: ignore notifications 2022-11-17 16:35:08 -06:00
justcool393 2c27b75b7a remove unnecessary imports 2022-11-17 15:44:29 -06:00
justcool393 83963470e8
user can_view functions (#460)
* user: move can_see_to user class

* stub out can_see in comments and posts

* make can_see a classmethod so it's usable for loggedoutfriends

* test

* kill me now

* threelargeclassesmating

* dfdfdfdfdfdfd

* sdsdsdsd

* classmethod should be above i think

* Revert "classmethod should be above i think"

This reverts commit df1772eb9e7e71bf7b89123f6277b648de2b1af3.

* Revert "Revert "classmethod should be above i think""

This reverts commit 32883406c2e2916fc6c436611376a1817c16cb84.

* test rewritnig thing

* go home python

* what the fuck python

* fix AttributeError

* sdsdsdsdsdsd

* lazy and user and stuff

* test

* Revert "test"

This reverts commit 45af5bb3d45f3ec17126ab117d494ec978062a38.

* merge

* newline

* test

* test 2

* Revert "test"

This reverts commit 196dae677e2ee8cd29261c93dcb747087cb399b6.

* revert test

* fix merge error

* fix import error ciruclation i think

* sdsd

* add type annotations back

* deleted_utc

* isinstance

* user_can_see in jinja and remove unnecessary things

* a bunch of stuff
remove can_see from comment and post
expand can_see to messages

* antiannoyingamountsofwhitespace

* fix for chudrama

* improve prev
2022-11-17 16:02:08 -05:00
Aevann1 07a76e0ffd exclude me from offsitementions 2022-11-16 10:34:48 +02:00
justcool393 adf22b494a
sub relationship class (#456)
* sub relationships

* abstract = True

* fix

* fix spelling mistake
2022-11-15 11:05:42 -05:00
justcool393 3df53c63c9 alts: don't count deleted alts 2022-11-15 09:21:12 -06:00
Aevann1 b130139f3d sneed 2022-11-15 16:55:21 +02: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
justcool393 c9ecb5d535
account linking improvements (#448)
currently account delinking is very messy and can sometimes just not work
we do codey stuff so it's not as bad
also we create a pretty page for mops to mop up borked account links

* alts: allow proper delinking

* fix prev commit

* url fix

* fix 500

* fixes

* :pepodrool:

* flag

* :pepodrool: redux

* sdsdsdsds

* correct endpoint

* fix html page

* alts: only adjust session history if flag is set

* fix 500

* allow relinking

* fsdsds

* :pepodrool: redux

* alts: don't fail if an alt isn't history

* use postToastSwitch + some API changes

* remove unnecessary variables

* d-none

* delink accounts mod action

* fa-link-slash

* alts: add form to create alt

* remove copied and pasted template

* rounded section

* UI improvement + fix

* \n

* fix status

* admin: remove duplicate route
admin: do a permissions check on 2 pages that need it
admin: set the manual flag for manually flagged alts

* variable change

* fix 500

* alts

* add shadowban icon to alt link tool

* shadowbanned tooltip

* add user info section

* fix 500, remove unnecessary form, and add alt votes button

* trans and also link to page

* margin

* sdsdsd

* stop the count

* fix prev commit

* with ctx

* plural

* alts

* don't show shadowbanned users to those who can't see them
this is... extremely rare and won't ever be seen in production however if perms were ever rearranged in the future, this keeps permissions correct

* shadowban check in alt list

* let shadow realm enthusiasts see shadowban alts

* sdsdsds

* test

* be graceful where needed

* sdsdsdsds

* alts: don't allow adding the same account
alts: clarify wording

* rename and reorder on admin panel

* EOL

* remove frankly unnecessary check

* try with a set

* test

* Revert "try with a set"

This reverts commit 72be353fba5ffa39b37590cc5d3bf584c94ee06e.

* Revert "Revert "try with a set""

This reverts commit 81e41890a192e8b46d0463477998e905fddf56ba.

* Revert "Revert "Revert "try with a set"""

This reverts commit be51592135a3c09848f993f0154bd2ac862ae505.

* clean up test
2022-11-14 12:32:13 -05:00
justcool393 000b4f4c37 can post in ghost threads 2022-11-14 11:20:34 -06:00
justcool393 c5bf7b33c5 add created_utc 2022-11-13 18:21:19 -06:00
Snakes e027909357
Fix notification count with muted modmails. 2022-11-12 16:56:40 -05:00
Aevann1 6b3c4048b5 add a space between 2 functions 2022-11-12 14:11:44 +02:00
Aevann1 4df96767ba count patron votes as real always 2022-11-12 14:11:28 +02:00
Aevann1 80d240a45b show join date on popover 2022-11-11 17:22:10 +02:00
Aevann1 8a8c55ed09 Revert "remove badges from popovers"
This reverts commit 39297b7c22.
2022-11-11 16:25:28 +02:00
Aevann1 9bfbe44bf0 fix bug that made jannies not able to see removed posts in profiles 2022-11-11 16:22:20 +02:00
Snakes 8e2f76729e
Amend 4f849c2: remove forgotten print debug. 2022-11-09 10:37:54 -05:00
Snakes 4f849c2c36
Fix userpage hat counter showing equipped.
Essentially, just needed to not reuse owned_hats.
2022-11-09 10:32:14 -05:00
Snakes e0f43c3668
Remove is_nofollow from backend. 2022-11-09 10:05:36 -05:00
Snakes ebb3957f41
Eager load submission listing relationships. 2022-11-09 09:16:22 -05:00
justcool393 26549a6e66
remove logged out routes (#433)
* remove /logged_out/ routes

* update sitemap, remove users route, and update header

* cloudflare cookie

* only mess with the cookie whenever we desire auth

* sitemap: (small) improvements
sitemap: fix little bug i introduced
sitemap: fix login redirects for /id/ routes

* sitemap: remove duplicate entry

* contact is auth desired

* imports: don't import what we don't need and bind late to the db

* praying to god this works

* keep yourself safe

* oh i actually need to commit and push lol

* import Sub

* t

* refix cache purger
2022-11-09 00:35:24 -05:00
Aevann1 39297b7c22 remove badges from popovers 2022-11-08 15:58:34 +02:00
Aevann1 8b1f76f727 add hole actions notifs for hole mods 2022-11-08 15:49:43 +02:00
justcool393 0fffa7efc0 rename truecoins to truescore 2022-11-06 23:04:34 -08:00
justcool393 2c532af1ce set defaults in user class and schema.sql 2022-11-06 20:06:37 -08:00
Snakes b121d39c17
Handle mod_date case when User not mod. 2022-11-03 20:10:25 -04:00
justcool393 339d5fe8f1 users: add profanity filter to censor our gosh darned potty mouthes 2022-11-03 17:59:18 -05:00
Aevann1 6b068de522 remove insane bloat 2022-11-03 21:23:37 +02:00
justcool393 753178a186 subs: fix exile behavior 2022-11-02 19:47:07 -05:00
justcool393 d5812096af voting: allow voting to cause a user's DC balance to go negative 2022-11-01 12:50:01 -05:00
Snakes 0ea738f1bc
Exclude limited-edition hats from profile counter. 2022-11-01 03:17:15 -04:00
justcool393 d53c714bb7 users: use with_for_update() in charge_account 2022-11-01 01:14:18 -05:00
justcool393 5af772c1f9 users: is_visible_to is False if v doesn't exist
this lets us use this function even with a logged out user
2022-10-30 03:04:46 -05:00
justcool393 5d2f4d203b users: add is_visible_to function for checking user visibility to a certain other user 2022-10-30 02:31:21 -05:00
justcool393 68deff8f60 users: is_following adjustments
users: move is_following check to part of the user model itself
users: also don't query followers if the username is wrong and we're redirecting anyway
2022-10-30 02:19:49 -05: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
Aevann1 8e2c869c84 fix last commit 2022-10-27 19:56:11 +02:00
Aevann1 ad358650e1 remove retarded bullshit I wasn't consulted about 2022-10-27 19:53:08 +02:00
Aevann1 033738342a add tooltip to jigsaw tier [WPD] 2022-10-25 22:03:07 +02:00
Aevann1 fbeac461ca refactor poorcel mode 2022-10-25 18:07:44 +02:00
gooseman 67826a52e0 remove hw 2022-10-24 15:28:43 -07:00
gooseman 8b98eabbb9 simultaneous hosts 2022-10-24 15:28:43 -07:00
Aevann1 4b37bd721b prevent carp from undoing award pins 2022-10-24 19:36:35 +02:00
justcool393 aa508fc076 remove discord 2022-10-16 05:42:52 -07:00
justcool393 32a4693da9 fix a couple of potentially rare 500s 2022-10-15 14:35:24 -07:00
Aevann1 c29b7e0871 remove chud rotating pfps 2022-10-15 08:57:28 +02:00
Aevann1 77312317f3 get rid of Boolean columns for permenant awards 2022-10-14 18:59:49 +02:00
Aevann1 89a0ff4a4b remove username reservation system 2022-10-14 14:01:06 +02:00
Snakes e5af46c4ae
Fix shadow visibility logic. 2022-10-13 00:10:34 -04:00
Snakes 166e33dc38
Clarify architecture of sort_objects. 2022-10-12 04:05:26 -04:00
Aevann1 d18e247513 Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost 2022-10-12 09:03:30 +02:00
Aevann1 2aa281e8c8 refactor sorting again (untested) 2022-10-12 09:03:28 +02:00
Aevann1 925ec12141 more shadowban refactor 2022-10-12 08:53:32 +02:00
justcool393 941b5fa82d vote realness is in user model 2022-10-11 23:47:47 -07:00
Aevann1 e1ee9a69e4 refactor seeing shadowbanned shit (untested) 2022-10-12 08:24:30 +02:00
Aevann1 b1abd33835 refactor sorting 2022-10-12 08:10:11 +02:00
Aevann1 e3a3cbd358 add "hot" comment sorting 2022-10-11 18:41:09 +02:00
Aevann1 d9253ddd67 change default for "Controversial" value in user class 2022-10-11 16:43:50 +02:00
Snakes 10921331fa
Move user hat properties for userpage to model. 2022-10-08 16:30:27 -04:00
Aevann1 aa8e7055fb rework env vars a bit 2022-10-08 02:43:04 +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 d9cc95dd71 fix global hole mod and template error 2022-10-06 20:06:22 -07:00
justcool393 e372158729
Merge branch 'frost' into permissions-refactor 2022-10-06 19:05:42 -07:00
Aevann1 4d15d76dfa show the earlylife parantheses in more places 2022-10-07 01:31:09 +02:00
Aevann1 9d6dcca07a remove duplicate function 2022-10-07 00:59:50 +02:00
justcool393 a30edea43d resolve conflict 2022-10-06 03:37:00 -07:00
justcool393 8bed8c64e8 rearrange and rename a couple of permissions 2022-10-06 00:55:54 -07:00
justcool393 f1275b90eb filter properly per poll: https://rdrama.net/post/79285/-/2845495 2022-10-06 00:04:46 -07:00
Aevann1 fea0ce115f do the result of this poll https://rdrama.org/post/79285/-/2845495?context=8#context 2022-10-06 08:41:48 +02:00
justcool393 dc5a132583 mop visibility, WPD notifications, and a fix with shadowbans 2022-10-05 22:25:45 -07:00
justcool393 68851ed986 profile views and modmail/hole creation notifications 2022-10-05 22:07:38 -07:00
justcool393 5739f128cf club and chudrama permissions 2022-10-05 21:52:15 -07:00
justcool393 35c294b421 shadowban perms and some more fixes 2022-10-05 19:24:27 -07:00
justcool393 d5a48871f8 user ban and also fix global hole mod a bit i hope i didn't screw up the templates 2022-10-05 18:58:43 -07:00
justcool393 4b78ed176a global moderation perm and add some more checks for const perm 2022-10-05 18:16:52 -07:00
Aevann1 dda49fdd70 the @Wieoaka question 2022-10-02 13:22:18 +02:00
Aevann1 186616728b allow tempbanned nibbas to mod holes 2022-10-01 19:23:09 +02:00
Aevann1 09cc43060d
add hole mod logs (#380) 2022-09-29 11:39:37 +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
Snakes f05ec93b95
Add gambling wager badge logic.
This commit touches more files than it ought to because this change
required untangling some circular imports, notably a lingering import
of files.helpers.slots in helpers.actions (presumably from old Snappy
gambling logic) and the User.active_blackjack_game accessor. Otherwise,
the logic is fairly straightforward.
2022-09-29 00:26:50 -04:00
Aevann1 ba19830075 fix last commit 2022-09-25 04:47:05 +02:00
Aevann1 d1bc2f3468 integrate check_ban_evade into check_for_alts 2022-09-23 14:33:58 +02:00
Snakes 3efaedbbec
Temporarily fix permas propagating as shadows. 2022-09-22 20:45:59 -04:00
Aevann1 6eea792b00 if ur reading this, fuck you 2022-09-22 21:54:42 +02:00
Aevann1 8a8a67a059 remove ban_evade logic 2022-09-22 21:40:14 +02:00
Aevann1 272e39ebf2 add spider award 2022-09-20 19:52:52 +02:00
Aevann1 b980c63d1b Revert "created_utc refactor"
This reverts commit 791aececbb.
2022-09-19 22:40:33 +02:00
Aevann1 b6df126012 stop me from getting modaction notifs 2022-09-19 22:13:23 +02:00
Aevann1 be9dc81455 remove bite award pfp 2022-09-19 21:29:29 +02:00