Author
|
zPlus <zplus@peers.community>
2018-07-19 06:59:14
|
Committer
|
zPlus <zplus@peers.community>
2018-07-19 06:59:14
|
Commit
|
d4059bd
(patch)
|
Tree
|
ecae06b
|
Parent(s)
|
|
+1 reply
modified: freepost/__init__.py
commits diff:
79b4349..d4059bd
1 file changed,
5 insertions,
2 deletions
—
download
Diffstat
Diff options
+5/-2
M freepost/__init__.py
689
|
689
|
|
# We have a text, add the reply and redirect to the new reply
|
690
|
690
|
|
reply_hash_id = database.new_comment (text, comment['postHashId'], user['id'], comment['id'])
|
691
|
691
|
|
|
692
|
|
- |
# TODO upvote comment
|
693
|
|
- |
# TODO Increase comments count for post
|
|
692
|
+ |
# Retrieve new comment
|
|
693
|
+ |
comment = database.get_comment (reply_hash_id)
|
|
694
|
+ |
|
|
695
|
+ |
# Automatically add an upvote for the original poster
|
|
696
|
+ |
database.vote_comment (comment['id'], user['id'], +1)
|
694
|
697
|
|
|
695
|
698
|
|
redirect (application.get_url ('post', hash_id=comment['postHashId']) + '#comment-' + reply_hash_id)
|
696
|
699
|
|
|