remotes/1693045480750635534/spooky-22
parent
d3fc580c79
commit
e92c5db120
|
@ -273,6 +273,8 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
|
||||||
|
|
||||||
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
||||||
|
|
||||||
|
if v and v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||||
|
|
||||||
if v and v.controversial:
|
if v and v.controversial:
|
||||||
for i in re.finditer('(/comments/.*?)"', body):
|
for i in re.finditer('(/comments/.*?)"', body):
|
||||||
url = i.group(1)
|
url = i.group(1)
|
||||||
|
|
|
@ -325,7 +325,9 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
|
||||||
if "?" in url: url += "&sort=controversial"
|
if "?" in url: url += "&sort=controversial"
|
||||||
else: url += "?sort=controversial"
|
else: url += "?sort=controversial"
|
||||||
return url
|
return url
|
||||||
elif self.url: return self.url
|
elif self.url:
|
||||||
|
if v and v.nitter: return self.url.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||||
|
return self.url
|
||||||
else: return ""
|
else: return ""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -355,6 +357,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
|
||||||
body = body.replace(s, r)
|
body = body.replace(s, r)
|
||||||
|
|
||||||
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
||||||
|
if v and v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||||
return body
|
return body
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -73,7 +73,8 @@ class User(Base, Stndrd, Age_times):
|
||||||
flairchanged = Column(Boolean, default=False)
|
flairchanged = Column(Boolean, default=False)
|
||||||
newtab = Column(Boolean, default=False)
|
newtab = Column(Boolean, default=False)
|
||||||
newtabexternal = Column(Boolean, default=True)
|
newtabexternal = Column(Boolean, default=True)
|
||||||
oldreddit = Column(Boolean, default=False)
|
oldreddit = Column(Boolean)
|
||||||
|
nitter = Column(Boolean)
|
||||||
controversial = Column(Boolean, default=False)
|
controversial = Column(Boolean, default=False)
|
||||||
submissions = relationship(
|
submissions = relationship(
|
||||||
"Submission",
|
"Submission",
|
||||||
|
|
|
@ -78,6 +78,10 @@ def settings_profile_post(v):
|
||||||
updated = True
|
updated = True
|
||||||
v.oldreddit = request.values.get("oldreddit", None) == 'true'
|
v.oldreddit = request.values.get("oldreddit", None) == 'true'
|
||||||
|
|
||||||
|
if request.values.get("nitter", v.nitter) != v.oldrnittereddit:
|
||||||
|
updated = True
|
||||||
|
v.nitter = request.values.get("nitter", None) == 'true'
|
||||||
|
|
||||||
if request.values.get("controversial", v.controversial) != v.controversial:
|
if request.values.get("controversial", v.controversial) != v.controversial:
|
||||||
updated = True
|
updated = True
|
||||||
v.controversial = request.values.get("controversial", None) == 'true'
|
v.controversial = request.values.get("controversial", None) == 'true'
|
||||||
|
|
Loading…
Reference in New Issue