fdsfdsfd
This commit is contained in:
parent
16a3dd95b8
commit
2e39f547fa
20 changed files with 285 additions and 171 deletions
|
@ -5645,6 +5645,14 @@ blockquote p {
|
|||
color: green !important;
|
||||
}
|
||||
|
||||
.text-lightgreen {
|
||||
color: lightgreen !important;
|
||||
}
|
||||
|
||||
.text-blue {
|
||||
color: #1D9BF0 !important;
|
||||
}
|
||||
|
||||
.timeline-Widget {
|
||||
max-height: 500px !important;
|
||||
overflow-y: scroll !important;
|
||||
|
|
BIN
files/assets/images/badges/Unblockable.webp
Normal file
BIN
files/assets/images/badges/Unblockable.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
|
@ -51,6 +51,8 @@ class User(Base):
|
|||
verifiedcolor = Column(String)
|
||||
marseyawarded = Column(Integer)
|
||||
longpost = Column(Integer)
|
||||
unblockable = Column(Boolean)
|
||||
bird = Column(Integer)
|
||||
email = deferred(Column(String))
|
||||
css = deferred(Column(String))
|
||||
profilecss = deferred(Column(String))
|
||||
|
|
|
@ -14,10 +14,7 @@ def send_notification(uid, text, autojanny=False):
|
|||
text_html = sanitize(text_html)
|
||||
|
||||
if autojanny: author_id = AUTOJANNY_ID
|
||||
else:
|
||||
author_id = NOTIFICATIONS_ID
|
||||
existing = g.db.query(Comment.id).filter(Comment.author_id == author_id, Comment.body_html == text_html, Comment.notifiedto == uid).first()
|
||||
if existing: abort(403)
|
||||
else: author_id = NOTIFICATIONS_ID
|
||||
|
||||
new_comment = Comment(author_id=author_id,
|
||||
parent_submission=None,
|
||||
|
|
|
@ -356,121 +356,13 @@ BADGES = {
|
|||
'name': 'Holly Jolly Marsey Artist',
|
||||
'description': 'Contributed a VERY JOLLY Marsey for Christmas 2021!'
|
||||
},
|
||||
87: {
|
||||
'name': 'Unblockable',
|
||||
'description': 'This user is unblockable'
|
||||
},
|
||||
}
|
||||
|
||||
AWARDS = {
|
||||
"shit": {
|
||||
"kind": "shit",
|
||||
"title": "Shit",
|
||||
"description": "Makes flies swarm the post.",
|
||||
"icon": "fas fa-poop",
|
||||
"color": "text-black-50",
|
||||
"price": 500
|
||||
},
|
||||
"fireflies": {
|
||||
"kind": "fireflies",
|
||||
"title": "Fireflies",
|
||||
"description": "Makes fireflies swarm the post.",
|
||||
"icon": "fas fa-sparkles",
|
||||
"color": "text-warning",
|
||||
"price": 500
|
||||
},
|
||||
"train": {
|
||||
"kind": "train",
|
||||
"title": "Train",
|
||||
"description": "Summons a train on the post.",
|
||||
"icon": "fas fa-train",
|
||||
"color": "text-pink",
|
||||
"price": 500
|
||||
},
|
||||
"pin": {
|
||||
"kind": "pin",
|
||||
"title": "1-Hour Pin",
|
||||
"description": "Pins the post/comment.",
|
||||
"icon": "fas fa-thumbtack fa-rotate--45",
|
||||
"color": "text-warning",
|
||||
"price": 750
|
||||
},
|
||||
"unpin": {
|
||||
"kind": "unpin",
|
||||
"title": "1-Hour Unpin",
|
||||
"description": "Removes 1 hour from the pin duration of the post/comment.",
|
||||
"icon": "fas fa-thumbtack fa-rotate--45",
|
||||
"color": "text-black",
|
||||
"price": 1000
|
||||
},
|
||||
"flairlock": {
|
||||
"kind": "flairlock",
|
||||
"title": "1-Day Flairlock",
|
||||
"description": "Sets a flair for the recipient and locks it or 24 hours.",
|
||||
"icon": "fas fa-lock",
|
||||
"color": "text-black",
|
||||
"price": 1250
|
||||
},
|
||||
"pizzashill": {
|
||||
"kind": "pizzashill",
|
||||
"title": "Pizzashill",
|
||||
"description": "Forces the recipient to make all posts/comments > 280 characters for 24 hours.",
|
||||
"icon": "fas fa-pizza-slice",
|
||||
"color": "text-orange",
|
||||
"price": 1500
|
||||
},
|
||||
"agendaposter": {
|
||||
"kind": "agendaposter",
|
||||
"title": "Agendaposter",
|
||||
"description": "Forces the agendaposter theme on the recipient for 24 hours.",
|
||||
"icon": "fas fa-snooze",
|
||||
"color": "text-purple",
|
||||
"price": 2500
|
||||
},
|
||||
"marsey": {
|
||||
"kind": "marsey",
|
||||
"title": "Marsey",
|
||||
"description": "Makes the recipient unable to post/comment anything but marsey emojis for 24 hours.",
|
||||
"icon": "fas fa-cat",
|
||||
"color": "text-orange",
|
||||
"price": 3000
|
||||
},
|
||||
"ban": {
|
||||
"kind": "ban",
|
||||
"title": "1-Day Ban",
|
||||
"description": "Bans the recipient for a day.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-danger",
|
||||
"price": 3000
|
||||
},
|
||||
"unban": {
|
||||
"kind": "unban",
|
||||
"title": "1-Day Unban",
|
||||
"description": "Removes 1 day from the ban duration of the recipient.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-success",
|
||||
"price": 3500
|
||||
},
|
||||
"grass": {
|
||||
"kind": "grass",
|
||||
"title": "Grass",
|
||||
"description": "Ban the recipient permanently (must provide a timestamped picture of them touching grass to the admins to get unbanned)",
|
||||
"icon": "fas fa-seedling",
|
||||
"color": "text-success",
|
||||
"price": 10000
|
||||
},
|
||||
"pause": {
|
||||
"kind": "pause",
|
||||
"title": "Pause",
|
||||
"description": "Gives the recipient the ability to pause profile anthems.",
|
||||
"icon": "fas fa-volume-mute",
|
||||
"color": "text-danger",
|
||||
"price": 20000
|
||||
},
|
||||
"unpausable": {
|
||||
"kind": "unpausable",
|
||||
"title": "Unpausable",
|
||||
"description": "Makes the profile anthem of the recipient unpausable.",
|
||||
"icon": "fas fa-volume",
|
||||
"color": "text-success",
|
||||
"price": 40000
|
||||
},
|
||||
"haunt": {
|
||||
"kind": "haunt",
|
||||
"title": "Haunt",
|
||||
|
@ -527,6 +419,110 @@ AWARDS = {
|
|||
"color": "text-orange",
|
||||
"price": 1000
|
||||
},
|
||||
"shit": {
|
||||
"kind": "shit",
|
||||
"title": "Shit",
|
||||
"description": "Makes flies swarm the post.",
|
||||
"icon": "fas fa-poop",
|
||||
"color": "text-black-50",
|
||||
"price": 500
|
||||
},
|
||||
"fireflies": {
|
||||
"kind": "fireflies",
|
||||
"title": "Fireflies",
|
||||
"description": "Makes fireflies swarm the post.",
|
||||
"icon": "fas fa-sparkles",
|
||||
"color": "text-warning",
|
||||
"price": 500
|
||||
},
|
||||
"train": {
|
||||
"kind": "train",
|
||||
"title": "Train",
|
||||
"description": "Summons a train on the post.",
|
||||
"icon": "fas fa-train",
|
||||
"color": "text-pink",
|
||||
"price": 500
|
||||
},
|
||||
"pin": {
|
||||
"kind": "pin",
|
||||
"title": "1-Hour Pin",
|
||||
"description": "Pins the post/comment.",
|
||||
"icon": "fas fa-thumbtack fa-rotate--45",
|
||||
"color": "text-warning",
|
||||
"price": 750
|
||||
},
|
||||
"unpin": {
|
||||
"kind": "unpin",
|
||||
"title": "1-Hour Unpin",
|
||||
"description": "Removes 1 hour from the pin duration of the post/comment.",
|
||||
"icon": "fas fa-thumbtack fa-rotate--45",
|
||||
"color": "text-black",
|
||||
"price": 1000
|
||||
},
|
||||
"flairlock": {
|
||||
"kind": "flairlock",
|
||||
"title": "1-Day Flairlock",
|
||||
"description": "Sets a flair for the recipient and locks it or 24 hours.",
|
||||
"icon": "fas fa-lock",
|
||||
"color": "text-black",
|
||||
"price": 1250
|
||||
},
|
||||
"pizzashill": {
|
||||
"kind": "pizzashill",
|
||||
"title": "Pizzashill",
|
||||
"description": "Forces the recipient to make all posts/comments > 280 characters for 24 hours.",
|
||||
"icon": "fas fa-pizza-slice",
|
||||
"color": "text-orange",
|
||||
"price": 1500
|
||||
},
|
||||
"bird": {
|
||||
"kind": "bird",
|
||||
"title": "Bird Site",
|
||||
"description": "Forces the recipient to make all posts/comments < 140 characters for 24 hours.",
|
||||
"icon": "fab fa-twitter",
|
||||
"color": "text-blue",
|
||||
"price": 1500
|
||||
},
|
||||
"agendaposter": {
|
||||
"kind": "agendaposter",
|
||||
"title": "Agendaposter",
|
||||
"description": "Forces the agendaposter theme on the recipient for 24 hours.",
|
||||
"icon": "fas fa-snooze",
|
||||
"color": "text-purple",
|
||||
"price": 2500
|
||||
},
|
||||
"marsey": {
|
||||
"kind": "marsey",
|
||||
"title": "Marsey",
|
||||
"description": "Makes the recipient unable to post/comment anything but marsey emojis for 24 hours.",
|
||||
"icon": "fas fa-cat",
|
||||
"color": "text-orange",
|
||||
"price": 3000
|
||||
},
|
||||
"ban": {
|
||||
"kind": "ban",
|
||||
"title": "1-Day Ban",
|
||||
"description": "Bans the recipient for a day.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-danger",
|
||||
"price": 3000
|
||||
},
|
||||
"unban": {
|
||||
"kind": "unban",
|
||||
"title": "1-Day Unban",
|
||||
"description": "Removes 1 day from the ban duration of the recipient.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-success",
|
||||
"price": 3500
|
||||
},
|
||||
"grass": {
|
||||
"kind": "grass",
|
||||
"title": "Grass",
|
||||
"description": "Ban the recipient permanently (must provide a timestamped picture of them touching grass to the admins to get unbanned)",
|
||||
"icon": "fas fa-seedling",
|
||||
"color": "text-success",
|
||||
"price": 10000
|
||||
},
|
||||
"eye": {
|
||||
"kind": "eye",
|
||||
"title": "All-Seeing Eye",
|
||||
|
@ -535,6 +531,30 @@ AWARDS = {
|
|||
"color": "text-silver",
|
||||
"price": 10000
|
||||
},
|
||||
"pause": {
|
||||
"kind": "pause",
|
||||
"title": "Pause",
|
||||
"description": "Gives the recipient the ability to pause profile anthems.",
|
||||
"icon": "fas fa-volume-mute",
|
||||
"color": "text-danger",
|
||||
"price": 20000
|
||||
},
|
||||
"unblockable": {
|
||||
"kind": "unblockable",
|
||||
"title": "Unblockable",
|
||||
"description": "Makes the recipient unblockable and removes all blocks on them.",
|
||||
"icon": "far fa-laugh-squint",
|
||||
"color": "text-lightgreen",
|
||||
"price": 25000
|
||||
},
|
||||
"unpausable": {
|
||||
"kind": "unpausable",
|
||||
"title": "Unpausable",
|
||||
"description": "Makes the profile anthem of the recipient unpausable.",
|
||||
"icon": "fas fa-volume",
|
||||
"color": "text-success",
|
||||
"price": 40000
|
||||
},
|
||||
"alt": {
|
||||
"kind": "alt",
|
||||
"title": "Alt-Seeing Eye",
|
||||
|
@ -603,6 +623,14 @@ AWARDS2 = {
|
|||
"color": "text-orange",
|
||||
"price": 1500
|
||||
},
|
||||
"bird": {
|
||||
"kind": "bird",
|
||||
"title": "Bird Site",
|
||||
"description": "Forces the recipient to make all posts/comments < 140 characters for 24 hours.",
|
||||
"icon": "fab fa-twitter",
|
||||
"color": "text-blue",
|
||||
"price": 1500
|
||||
},
|
||||
"agendaposter": {
|
||||
"kind": "agendaposter",
|
||||
"title": "Agendaposter",
|
||||
|
@ -659,6 +687,14 @@ AWARDS2 = {
|
|||
"color": "text-danger",
|
||||
"price": 20000
|
||||
},
|
||||
"unblockable": {
|
||||
"kind": "unblockable",
|
||||
"title": "Unblockable",
|
||||
"description": "Makes the recipient unblockable and removes all blocks on them.",
|
||||
"icon": "far fa-laugh-squint",
|
||||
"color": "text-lightgreen",
|
||||
"price": 25000
|
||||
},
|
||||
"unpausable": {
|
||||
"kind": "unpausable",
|
||||
"title": "Unpausable",
|
||||
|
|
|
@ -55,8 +55,7 @@ def shop(v):
|
|||
"icon": "fas fa-poop",
|
||||
"color": "text-black-50",
|
||||
"owned": 0,
|
||||
"price": 500,
|
||||
"MB": True
|
||||
"price": 500
|
||||
},
|
||||
"fireflies": {
|
||||
"kind": "fireflies",
|
||||
|
@ -65,8 +64,7 @@ def shop(v):
|
|||
"icon": "fas fa-sparkles",
|
||||
"color": "text-warning",
|
||||
"owned": 0,
|
||||
"price": 500,
|
||||
"MB": True
|
||||
"price": 500
|
||||
},
|
||||
"train": {
|
||||
"kind": "train",
|
||||
|
@ -75,8 +73,7 @@ def shop(v):
|
|||
"icon": "fas fa-train",
|
||||
"color": "text-pink",
|
||||
"owned": 0,
|
||||
"price": 500,
|
||||
"MB": True
|
||||
"price": 500
|
||||
},
|
||||
"pin": {
|
||||
"kind": "pin",
|
||||
|
@ -85,8 +82,7 @@ def shop(v):
|
|||
"icon": "fas fa-thumbtack fa-rotate--45",
|
||||
"color": "text-warning",
|
||||
"owned": 0,
|
||||
"price": 750,
|
||||
"MB": True
|
||||
"price": 750
|
||||
},
|
||||
"unpin": {
|
||||
"kind": "unpin",
|
||||
|
@ -95,8 +91,7 @@ def shop(v):
|
|||
"icon": "fas fa-thumbtack fa-rotate--45",
|
||||
"color": "text-black",
|
||||
"owned": 0,
|
||||
"price": 1000,
|
||||
"MB": True
|
||||
"price": 1000
|
||||
},
|
||||
"flairlock": {
|
||||
"kind": "flairlock",
|
||||
|
@ -105,8 +100,7 @@ def shop(v):
|
|||
"icon": "fas fa-lock",
|
||||
"color": "text-black",
|
||||
"owned": 0,
|
||||
"price": 1250,
|
||||
"MB": True
|
||||
"price": 1250
|
||||
},
|
||||
"pizzashill": {
|
||||
"kind": "pizzashill",
|
||||
|
@ -115,8 +109,16 @@ def shop(v):
|
|||
"icon": "fas fa-pizza-slice",
|
||||
"color": "text-orange",
|
||||
"owned": 0,
|
||||
"price": 1500,
|
||||
"MB": True
|
||||
"price": 1500
|
||||
},
|
||||
"bird": {
|
||||
"kind": "bird",
|
||||
"title": "Bird Site",
|
||||
"description": "Forces the recipient to make all posts/comments < 140 characters for 24 hours.",
|
||||
"icon": "fab fa-twitter",
|
||||
"color": "text-blue",
|
||||
"owned": 0,
|
||||
"price": 1500
|
||||
},
|
||||
"agendaposter": {
|
||||
"kind": "agendaposter",
|
||||
|
@ -125,8 +127,7 @@ def shop(v):
|
|||
"icon": "fas fa-snooze",
|
||||
"color": "text-purple",
|
||||
"owned": 0,
|
||||
"price": 2500,
|
||||
"MB": True
|
||||
"price": 2500
|
||||
},
|
||||
"marsey": {
|
||||
"kind": "marsey",
|
||||
|
@ -135,8 +136,7 @@ def shop(v):
|
|||
"icon": "fas fa-cat",
|
||||
"color": "text-orange",
|
||||
"owned": 0,
|
||||
"price": 3000,
|
||||
"MB": True
|
||||
"price": 3000
|
||||
},
|
||||
"ban": {
|
||||
"kind": "ban",
|
||||
|
@ -145,8 +145,7 @@ def shop(v):
|
|||
"icon": "fas fa-gavel",
|
||||
"color": "text-danger",
|
||||
"owned": 0,
|
||||
"price": 3000,
|
||||
"MB": True
|
||||
"price": 3000
|
||||
},
|
||||
"unban": {
|
||||
"kind": "unban",
|
||||
|
@ -155,8 +154,7 @@ def shop(v):
|
|||
"icon": "fas fa-gavel",
|
||||
"color": "text-success",
|
||||
"owned": 0,
|
||||
"price": 3500,
|
||||
"MB": True
|
||||
"price": 3500
|
||||
},
|
||||
"grass": {
|
||||
"kind": "grass",
|
||||
|
@ -165,8 +163,7 @@ def shop(v):
|
|||
"icon": "fas fa-seedling",
|
||||
"color": "text-success",
|
||||
"owned": 0,
|
||||
"price": 10000,
|
||||
"MB": False
|
||||
"price": 10000
|
||||
},
|
||||
"eye": {
|
||||
"kind": "eye",
|
||||
|
@ -175,8 +172,7 @@ def shop(v):
|
|||
"icon": "fas fa-eye",
|
||||
"color": "text-silver",
|
||||
"owned": 0,
|
||||
"price": 10000,
|
||||
"MB": False
|
||||
"price": 10000
|
||||
},
|
||||
"pause": {
|
||||
"kind": "pause",
|
||||
|
@ -185,8 +181,16 @@ def shop(v):
|
|||
"icon": "fas fa-volume-mute",
|
||||
"color": "text-danger",
|
||||
"owned": 0,
|
||||
"price": 20000,
|
||||
"MB": False
|
||||
"price": 20000
|
||||
},
|
||||
"unblockable": {
|
||||
"kind": "unblockable",
|
||||
"title": "Unblockable",
|
||||
"description": "Makes the recipient unblockable and removes all blocks on them.",
|
||||
"icon": "far fa-laugh-squint",
|
||||
"color": "text-lightgreen",
|
||||
"owned": 0,
|
||||
"price": 25000
|
||||
},
|
||||
"unpausable": {
|
||||
"kind": "unpausable",
|
||||
|
@ -195,8 +199,7 @@ def shop(v):
|
|||
"icon": "fas fa-volume",
|
||||
"color": "text-success",
|
||||
"owned": 0,
|
||||
"price": 40000,
|
||||
"MB": False
|
||||
"price": 40000
|
||||
},
|
||||
"alt": {
|
||||
"kind": "alt",
|
||||
|
@ -205,8 +208,7 @@ def shop(v):
|
|||
"icon": "fas fa-eye",
|
||||
"color": "text-gold",
|
||||
"owned": 0,
|
||||
"price": 50000,
|
||||
"MB": False
|
||||
"price": 50000
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -290,6 +292,14 @@ def buy(v, award):
|
|||
"color": "text-orange",
|
||||
"price": 1500,
|
||||
},
|
||||
"bird": {
|
||||
"kind": "bird",
|
||||
"title": "Bird Site",
|
||||
"description": "Forces the recipient to make all posts/comments < 140 characters for 24 hours.",
|
||||
"icon": "fab fa-twitter",
|
||||
"color": "text-blue",
|
||||
"price": 1500
|
||||
},
|
||||
"agendaposter": {
|
||||
"kind": "agendaposter",
|
||||
"title": "Agendaposter",
|
||||
|
@ -346,6 +356,14 @@ def buy(v, award):
|
|||
"color": "text-danger",
|
||||
"price": 20000
|
||||
},
|
||||
"unblockable": {
|
||||
"kind": "unblockable",
|
||||
"title": "Unblockable",
|
||||
"description": "Makes the recipient unblockable and removes all blocks on them.",
|
||||
"icon": "far fa-laugh-squint",
|
||||
"color": "text-lightgreen",
|
||||
"price": 25000
|
||||
},
|
||||
"unpausable": {
|
||||
"kind": "unpausable",
|
||||
"title": "Unpausable",
|
||||
|
@ -542,6 +560,9 @@ def award_post(pid, v):
|
|||
if author.longpost: author.longpost += 86400
|
||||
else: author.longpost = time.time() + 86400
|
||||
send_notification(IDIO_ID, f"@{v.username} used {kind} award on {request.host_url}{post.shortlink}")
|
||||
elif kind == "bird":
|
||||
if author.bird: author.bird += 86400
|
||||
else: author.bird = time.time() + 86400
|
||||
elif kind == "eye":
|
||||
author.eye = True
|
||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||
|
@ -552,6 +573,12 @@ def award_post(pid, v):
|
|||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||
new_badge = Badge(badge_id=84, user_id=author.id)
|
||||
g.db.add(new_badge)
|
||||
elif kind == "unblockable":
|
||||
author.unblockable = True
|
||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||
new_badge = Badge(badge_id=87, user_id=author.id)
|
||||
g.db.add(new_badge)
|
||||
for block in g.db.query(UserBlock).filter_by(target_id=author.id).all(): g.db.delete(block)
|
||||
|
||||
post.author.received_award_count += 1
|
||||
g.db.add(post.author)
|
||||
|
@ -676,6 +703,9 @@ def award_comment(cid, v):
|
|||
if author.longpost: author.longpost += 86400
|
||||
else: author.longpost = time.time() + 86400
|
||||
send_notification(IDIO_ID, f"@{v.username} used {kind} award on {request.host_url}{c.shortlink}")
|
||||
elif kind == "bird":
|
||||
if author.bird: author.bird += 86400
|
||||
else: author.bird = time.time() + 86400
|
||||
elif kind == "eye":
|
||||
author.eye = True
|
||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||
|
@ -686,6 +716,12 @@ def award_comment(cid, v):
|
|||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||
new_badge = Badge(badge_id=84, user_id=author.id)
|
||||
g.db.add(new_badge)
|
||||
elif kind == "unblockable":
|
||||
author.unblockable = True
|
||||
send_notification(CARP_ID, f"@{v.username} used {kind} award!")
|
||||
new_badge = Badge(badge_id=87, user_id=author.id)
|
||||
g.db.add(new_badge)
|
||||
for block in g.db.query(UserBlock).filter_by(target_id=author.id).all(): g.db.delete(block)
|
||||
|
||||
c.author.received_award_count += 1
|
||||
g.db.add(c.author)
|
||||
|
|
|
@ -169,6 +169,11 @@ def api_comment(v):
|
|||
v.longpost = None
|
||||
g.db.add(v)
|
||||
elif len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird:
|
||||
if time.time() > v.bird:
|
||||
v.bird = None
|
||||
g.db.add(v)
|
||||
elif len(body) > 140: return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
if not body and not request.files.get('file'): return {"error":"You need to actually write something!"}, 400
|
||||
|
||||
|
@ -194,7 +199,10 @@ def api_comment(v):
|
|||
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 403
|
||||
|
||||
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
if v.longpost:
|
||||
if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird:
|
||||
if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
bans = filter_comment_html(body_html)
|
||||
|
||||
|
@ -627,6 +635,11 @@ def edit_comment(cid, v):
|
|||
v.longpost = None
|
||||
g.db.add(v)
|
||||
elif len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird:
|
||||
if time.time() > v.bird:
|
||||
v.bird = None
|
||||
g.db.add(v)
|
||||
elif len(body) > 140: return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE):
|
||||
if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'})')
|
||||
|
@ -635,7 +648,10 @@ def edit_comment(cid, v):
|
|||
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 403
|
||||
|
||||
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
if v.longpost:
|
||||
if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird:
|
||||
if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
bans = filter_comment_html(body_html)
|
||||
|
||||
|
|
|
@ -242,6 +242,11 @@ def edit_post(pid, v):
|
|||
v.longpost = None
|
||||
g.db.add(v)
|
||||
elif len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird:
|
||||
if time.time() > v.bird:
|
||||
v.bird = None
|
||||
g.db.add(v)
|
||||
elif len(body) > 140: return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
if title != p.title:
|
||||
title_html = filter_title(title)
|
||||
|
@ -267,7 +272,10 @@ def edit_post(pid, v):
|
|||
p.body = body
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 40
|
||||
|
||||
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
if v.longpost:
|
||||
if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird:
|
||||
if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
p.body_html = body_html
|
||||
|
||||
|
@ -532,7 +540,10 @@ def submit_post(v):
|
|||
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html))) > 0: return {"error":"You can only type marseys!"}, 40
|
||||
|
||||
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
if v.longpost:
|
||||
if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird:
|
||||
if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
if url:
|
||||
if "/i.imgur.com/" in url: url = url.replace(".png", ".webp").replace(".jpg", ".webp").replace(".jpeg", ".webp")
|
||||
|
@ -621,6 +632,11 @@ def submit_post(v):
|
|||
v.longpost = None
|
||||
g.db.add(v)
|
||||
elif len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird:
|
||||
if time.time() > v.bird:
|
||||
v.bird = None
|
||||
g.db.add(v)
|
||||
elif len(body) > 140: return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
dup = g.db.query(Submission).filter(
|
||||
Submission.author_id == v.id,
|
||||
|
@ -703,7 +719,10 @@ def submit_post(v):
|
|||
|
||||
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 400
|
||||
|
||||
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
if v.longpost:
|
||||
if len(body) < 280 or ' [](' in body or body.startswith('[]('): return {"error":"You have to type more than 280 characters!"}, 403
|
||||
elif v.bird:
|
||||
if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
if len(body_html) > 20000: return {"error":"Submission body too long!"}, 400
|
||||
|
||||
|
|
|
@ -825,6 +825,8 @@ def settings_block_user(v):
|
|||
|
||||
user = get_user(request.values.get("username"), graceful=True)
|
||||
|
||||
if user.unblockable: return {"error": "This user is unblockable."}, 403
|
||||
|
||||
if not user:
|
||||
return {"error": "That user doesn't exist."}, 404
|
||||
|
||||
|
@ -869,8 +871,6 @@ def settings_unblock_user(v):
|
|||
|
||||
g.db.delete(x)
|
||||
|
||||
|
||||
|
||||
existing = g.db.query(Notification.id).filter_by(unblocksender=v.id, user_id=user.id).first()
|
||||
if not existing: send_unblock_notif(v.id, user.id, f"@{v.username} has unblocked you!")
|
||||
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=120">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
{% endif %}
|
||||
|
||||
</head>
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
|
||||
@media (min-width: 767.98px) {
|
||||
.award-columns {
|
||||
column-count: 8 !important;
|
||||
column-count: 9 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -252,12 +252,12 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=120">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=120">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
{% endif %}
|
||||
|
||||
<div class="row justify-content-around">
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<title>2-Step Login - {{'SITE_NAME' | app_config}}</title>
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
|
||||
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=120">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
|
||||
<link href="/assets/css/fa.css?v=52" rel="stylesheet">
|
||||
|
|
|
@ -40,10 +40,10 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
{% endif %}
|
||||
|
||||
<link href="/assets/css/fa.css?v=52" rel="stylesheet">
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
{% set kind = a['kind'] %}
|
||||
<td style="font-weight: bold">
|
||||
<a class="d-flex btn btn-success {% if v.coins < a['price'] %}disabled{% endif %}" href="javascript:void(0)" onclick="post_toast('/buy/{{kind}}')"><span class="m-auto">Buy</span></a>
|
||||
{% if v.procoins and a['MB'] %}<a class="d-flex marseybux btn btn-success {% if v.procoins < a['price'] %}disabled{% endif %}" href="javascript:void(0)" onclick="post_toast('/buy/{{kind}}?mb=true')"><span class="m-auto">Buy with Marseybux</span></a>{% endif %}
|
||||
{% if v.procoins and a['price'] > 3500 %}<a class="d-flex marseybux btn btn-success {% if v.procoins < a['price'] %}disabled{% endif %}" href="javascript:void(0)" onclick="post_toast('/buy/{{kind}}?mb=true')"><span class="m-auto">Buy with Marseybux</span></a>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -31,11 +31,11 @@
|
|||
{% block stylesheets %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=120">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=119">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120">
|
||||
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue