diff --git a/files/classes/user.py b/files/classes/user.py index cb9e054bd..376afbad8 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -98,6 +98,7 @@ class User(Base, Stndrd, Age_times): login_nonce = Column(Integer, default=0) reserved = Column(String(256)) coins = Column(Integer, default=0) + truecoins = Column(Integer, default=0) mfa_secret = deferred(Column(String(16))) is_private = Column(Boolean, default=False) stored_subscriber_count = Column(Integer, default=0) diff --git a/files/routes/votes.py b/files/routes/votes.py index 43cc2d930..5105002d6 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -76,15 +76,18 @@ def api_vote_post(post_id, new, v): if existing: if existing.vote_type == 0 and new != 0: post.author.coins += 1 + post.author.truecoins += 1 g.db.add(post.author) elif existing.vote_type != 0 and new == 0: post.author.coins -= 1 + post.author.truecoins -= 1 g.db.add(post.author) existing.vote_type = new g.db.add(existing) else: if new != 0: post.author.coins += 1 + post.author.truecoins += 1 g.db.add(post.author) vote = Vote(user_id=v.id, vote_type=new, @@ -126,15 +129,18 @@ def api_vote_comment(comment_id, new, v): if existing: if existing.vote_type == 0 and new != 0: comment.author.coins += 1 + comment.author.truecoins += 1 g.db.add(comment.author) elif existing.vote_type != 0 and new == 0: comment.author.coins -= 1 + comment.author.truecoins -= 1 g.db.add(comment.author) existing.vote_type = new g.db.add(existing) else: if new != 0: comment.author.coins += 1 + comment.author.truecoins += 1 g.db.add(comment.author) vote = CommentVote(user_id=v.id, vote_type=new,