Fix score on already voted comments

Fixes #12
Signed-off-by: Balazs Toldi <balazs@toldi.eu>
This commit is contained in:
Balazs Toldi 2023-07-27 07:17:03 +02:00
parent f2f057827a
commit 2828429120
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58

View File

@ -290,6 +290,8 @@ public class ParseComment {
int score = countsObj.getInt("score"); int score = countsObj.getInt("score");
int voteType = (jsonObject.isNull("my_vote")) ? 0 : jsonObject.getInt("my_vote"); int voteType = (jsonObject.isNull("my_vote")) ? 0 : jsonObject.getInt("my_vote");
if (voteType != 0)
score -= 1;
boolean isSubmitter = creatorObj.getInt("id") == postObj.getInt("creator_id"); boolean isSubmitter = creatorObj.getInt("id") == postObj.getInt("creator_id");
String distinguished = commentObj.getString("distinguished"); String distinguished = commentObj.getString("distinguished");
String permalink = commentObj.getString("ap_id"); String permalink = commentObj.getString("ap_id");