From f9d1df54bf7edbdcc975d30698e90f97d75956ae Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 23 Sep 2022 16:41:56 +0200 Subject: [PATCH 1/4] make pin and unpin award work on a basic of 6 hours (unlike posts which is 1 hour) --- files/routes/awards.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index df1490c436..ee67da8c98 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -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 From c7b41f3b57530de2c0ccb4a3e060d8e6809fd50e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 23 Sep 2022 16:43:45 +0200 Subject: [PATCH 2/4] update pin/unpin award description --- files/helpers/const.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index b8eb61c122..ec462d2699 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -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 From 5740ed3f00ffb9fa2e25d1265985b0b99b0263cf Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 23 Sep 2022 16:56:01 +0200 Subject: [PATCH 3/4] fix capitalization --- files/classes/mod_logs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/classes/mod_logs.py b/files/classes/mod_logs.py index a847f48a63..34a20db20b 100644 --- a/files/classes/mod_logs.py +++ b/files/classes/mod_logs.py @@ -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' } From 08f904581886930ddb11e5b415ae162c5e588a44 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 23 Sep 2022 17:02:09 +0200 Subject: [PATCH 4/4] remove linefeed at the end --- files/classes/mod_logs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/classes/mod_logs.py b/files/classes/mod_logs.py index 34a20db20b..f17e860f55 100644 --- a/files/classes/mod_logs.py +++ b/files/classes/mod_logs.py @@ -448,4 +448,4 @@ ACTIONTYPES = { ACTIONTYPES2 = deepcopy(ACTIONTYPES) ACTIONTYPES2.pop("shadowban") -ACTIONTYPES2.pop("unshadowban") +ACTIONTYPES2.pop("unshadowban") \ No newline at end of file