forked from rDrama/rDrama
Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost
commit
cca5ec8b1a
|
@ -435,12 +435,12 @@ ACTIONTYPES = {
|
|||
"color": 'bg-success'
|
||||
},
|
||||
'update_hat': {
|
||||
"str": 'Updated hat image',
|
||||
"str": 'updated hat image',
|
||||
"icon": 'fa-hat-cowboy',
|
||||
"color": 'bg-success'
|
||||
},
|
||||
'update_marsey': {
|
||||
"str": 'Updated marsey image',
|
||||
"str": 'updated marsey image',
|
||||
"icon": 'fa-cat',
|
||||
"color": 'bg-success'
|
||||
}
|
||||
|
@ -448,4 +448,4 @@ ACTIONTYPES = {
|
|||
|
||||
ACTIONTYPES2 = deepcopy(ACTIONTYPES)
|
||||
ACTIONTYPES2.pop("shadowban")
|
||||
ACTIONTYPES2.pop("unshadowban")
|
||||
ACTIONTYPES2.pop("unshadowban")
|
|
@ -539,8 +539,8 @@ AWARDS = {
|
|||
},
|
||||
"unpin": {
|
||||
"kind": "unpin",
|
||||
"title": "1-Hour Unpin",
|
||||
"description": "Removes 1 hour from the pin duration of the post/comment.",
|
||||
"title": "Unpin",
|
||||
"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",
|
||||
"color": "text-black",
|
||||
"price": 1000
|
||||
|
@ -555,8 +555,8 @@ AWARDS = {
|
|||
},
|
||||
"pin": {
|
||||
"kind": "pin",
|
||||
"title": "1-Hour Pin",
|
||||
"description": "Pins the post/comment.",
|
||||
"title": "Pin",
|
||||
"description": "Pins a post for 1 hour or a comment for 6 hours.",
|
||||
"icon": "fas fa-thumbtack fa-rotate--45",
|
||||
"color": "text-warning",
|
||||
"price": 1500
|
||||
|
|
|
@ -267,12 +267,20 @@ def award_thing(v, thing_type, id):
|
|||
thing.stickied_utc += 3600
|
||||
else:
|
||||
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)
|
||||
cache.delete_memoized(frontlist)
|
||||
elif kind == "unpin":
|
||||
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:
|
||||
thing.stickied = None
|
||||
thing.stickied_utc = None
|
||||
|
|
Loading…
Reference in New Issue