From a84cb6f20ac0651001840d0310b2e6abe2457e43 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 22 Nov 2021 16:31:07 +0200 Subject: [PATCH] gffg --- files/classes/comment.py | 9 +++++---- files/classes/submission.py | 8 +++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index aa393ed64..d19e92a11 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -329,10 +329,11 @@ class Comment(Base): url_noquery = url.split('?')[0] body = body.replace(url, f"{url_noquery}?{urlencode(p, True)}") - if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 600: - rand = randint(1,16) - if self.upvotes < rand: - self.upvotes = rand + if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 60: + ti = int(time.time() - self.created_utc)/10 + maxupvotes = min(ti, 31) + if self.upvotes < maxupvotes: + self.upvotes += randint(0, 5) g.db.add(self) g.db.commit() diff --git a/files/classes/submission.py b/files/classes/submission.py index 1dacf44bb..f6815bfb9 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -331,10 +331,12 @@ class Submission(Base): if v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net") - if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 600: - rand = random.randint(1,16) + if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 20: + ti = int(time.time() - self.created_utc)/10 + maxupvotes = min(ti, 27) + rand = random.randint(1, maxupvotes) if self.upvotes < rand: - self.upvotes = rand + self.upvotes += random.randint(0,5) g.db.add(self) g.db.commit()