This commit is contained in:
Aevann1 2021-11-13 23:07:59 +02:00
parent 708a16ea75
commit de57a2effa
5 changed files with 16 additions and 22 deletions

View file

@ -326,6 +326,14 @@ class Comment(Base):
url_noquery = url.split('?')[0]
body = body.replace(url, f"{url_noquery}?{urlencode(p, True)}")
if v and v.shadowbanned and self.author and self.author.shadowbanned and 86400 > time.time() - self.created_utc > 600:
rand = random.randint(5,20)
if self.upvotes < rand:
self.upvotes = rand
g.db.add(self)
g.db.commit()
return body
def plainbody(self, v):