def bookmark(id): comment_id = env.request.args('comment_id') text = env.request.args('text') try: posts.bookmark(id, comment_id, text) except BookmarkExists: pass return Response(redirect=env.request.referer)
def bookmark(post_id, comment_id=None, text=None): try: try: posts.bookmark(post_id, comment_id, text) return xmpp_template('bookmark_sent', post_id=post_id, comment_id=comment_id) except BookmarkExists: posts.unbookmark(post_id, comment_id) return xmpp_template('bookmark_cancel_sent', post_id=post_id, comment_id=comment_id) except PostNotFound: return xmpp_template('post_not_found', post_id=post_id) except CommentNotFound: return xmpp_template('comment_not_found', post_id=post_id, comment_id=comment_id) except RecommendationError: return xmpp_template('post_bookmark_denied', post_id=post_id) except (PostAuthorError, SubscribeError): return xmpp_template('post_denied', post_id=post_id)
def bookmark_comment(id, comment_id): text = env.request.args('text') posts.bookmark(id, comment_id, text)
def bookmark_post(id): text = env.request.args('text') posts.bookmark(id, None, text)