aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-01-15 18:25:04 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-01-15 18:25:04 -0200
commitf37fd1cd03d15aeba44c05d83c515da8196fe889 (patch)
treef4f875e35bf2dd1cfe000c36437cd2fa505ddef1
parentff6af8104166de4dc77842ef1d23079eb38dfaa2 (diff)
Implement comment viewing in sx-display
-rw-r--r--sx-interaction.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/sx-interaction.el b/sx-interaction.el
index 4f4e31f..74602f2 100644
--- a/sx-interaction.el
+++ b/sx-interaction.el
@@ -184,10 +184,20 @@ likes."
(sx-display-question
(sx-question-get-from-answer .site_par .answer_id)
'focus)
- (sx--find-in-buffer 'answer .answer_id))
+ (if .comment_id
+ (sx--find-in-buffer 'comment .comment_id)
+ (sx--find-in-buffer 'answer .answer_id)))
(.question_id
(sx-display-question
- (sx-question-get-question .site_par .id) 'focus))
+ (sx-question-get-question .site_par .question_id) 'focus)
+ (when .comment_id
+ (sx--find-in-buffer 'comment .comment_id)))
+ ;; `sx-question-get-from-comment' takes 2 api requests, so we
+ ;; test it last.
+ (.comment_id
+ (sx-display-question
+ (sx-question-get-from-comment .site_par .id) 'focus)
+ (sx--find-in-buffer 'comment .comment_id))
(.notification_type
(sx-message "Viewing notifications is not yet implemented"))
(.item_type (sx-open-link .link)))))