forked from rDrama/rDrama
1
0
Fork 0

Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost

master
Aevann1 2022-09-23 17:04:35 +00:00
commit cca5ec8b1a
3 changed files with 17 additions and 9 deletions

View File

@ -435,12 +435,12 @@ ACTIONTYPES = {
"color": 'bg-success' "color": 'bg-success'
}, },
'update_hat': { 'update_hat': {
"str": 'Updated hat image', "str": 'updated hat image',
"icon": 'fa-hat-cowboy', "icon": 'fa-hat-cowboy',
"color": 'bg-success' "color": 'bg-success'
}, },
'update_marsey': { 'update_marsey': {
"str": 'Updated marsey image', "str": 'updated marsey image',
"icon": 'fa-cat', "icon": 'fa-cat',
"color": 'bg-success' "color": 'bg-success'
} }
@ -448,4 +448,4 @@ ACTIONTYPES = {
ACTIONTYPES2 = deepcopy(ACTIONTYPES) ACTIONTYPES2 = deepcopy(ACTIONTYPES)
ACTIONTYPES2.pop("shadowban") ACTIONTYPES2.pop("shadowban")
ACTIONTYPES2.pop("unshadowban") ACTIONTYPES2.pop("unshadowban")

View File

@ -539,8 +539,8 @@ AWARDS = {
}, },
"unpin": { "unpin": {
"kind": "unpin", "kind": "unpin",
"title": "1-Hour Unpin", "title": "Unpin",
"description": "Removes 1 hour from the pin duration of the post/comment.", "description": "Removes 1 hour from the pin duration of a post or 6 hours from the pin duration of a comment.",
"icon": "fas fa-thumbtack fa-rotate--45", "icon": "fas fa-thumbtack fa-rotate--45",
"color": "text-black", "color": "text-black",
"price": 1000 "price": 1000
@ -555,8 +555,8 @@ AWARDS = {
}, },
"pin": { "pin": {
"kind": "pin", "kind": "pin",
"title": "1-Hour Pin", "title": "Pin",
"description": "Pins the post/comment.", "description": "Pins a post for 1 hour or a comment for 6 hours.",
"icon": "fas fa-thumbtack fa-rotate--45", "icon": "fas fa-thumbtack fa-rotate--45",
"color": "text-warning", "color": "text-warning",
"price": 1500 "price": 1500

View File

@ -267,12 +267,20 @@ def award_thing(v, thing_type, id):
thing.stickied_utc += 3600 thing.stickied_utc += 3600
else: else:
thing.stickied = f'{v.username} (pin award)' thing.stickied = f'{v.username} (pin award)'
thing.stickied_utc = int(time.time()) + 3600 if thing_type == 'comment':
thing.stickied_utc = int(time.time()) + 3600*6
else:
thing.stickied_utc = int(time.time()) + 3600
g.db.add(thing) g.db.add(thing)
cache.delete_memoized(frontlist) cache.delete_memoized(frontlist)
elif kind == "unpin": elif kind == "unpin":
if not thing.stickied_utc: abort(403) if not thing.stickied_utc: abort(403)
t = thing.stickied_utc - 3600
if thing_type == 'comment':
t = thing.stickied_utc - 3600*6
else:
t = thing.stickied_utc - 3600
if time.time() > t: if time.time() > t:
thing.stickied = None thing.stickied = None
thing.stickied_utc = None thing.stickied_utc = None