diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-15 14:20:29 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-15 14:20:29 -0200 |
commit | 028d30609b6109b682308c405b586e1eebe65972 (patch) | |
tree | d49c2b77469f7a69e2564f1c870c773dedfb983d | |
parent | a36ab1aecfdf62d7d3763cff2490c61cf63d4930 (diff) |
sx-open-link redirects chat links to browser
-rw-r--r-- | sx-interaction.el | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/sx-interaction.el b/sx-interaction.el index da9c4aa..d6fdb7f 100644 --- a/sx-interaction.el +++ b/sx-interaction.el @@ -136,20 +136,24 @@ Element can be a question, answer, or comment." (save-excursion (yank)) (thing-at-point 'url)))) (list (read-string (concat "Link (" def "): ") nil nil def)))) - (let ((data (sx--link-to-data link))) - (sx-assoc-let data - (cl-case .type - (answer - (sx-display-question - (sx-question-get-from-answer .site_par .id) 'focus) - (sx--find-in-buffer 'answer .id)) - (question - (sx-display-question - (sx-question-get-question .site_par .id) 'focus)) - (t (sx-message - "Don't know how to open this link, please file a bug report: %s" - link) - nil))))) + ;; For now, we have no chance of handling chat links, let's just + ;; send them to the browser. + (if (string-match (rx string-start "http" (opt "s") "://chat.")) + (sx-visit-externally link) + (let ((data (sx--link-to-data link))) + (sx-assoc-let data + (cl-case .type + (answer + (sx-display-question + (sx-question-get-from-answer .site_par .id) 'focus) + (sx--find-in-buffer 'answer .id)) + (question + (sx-display-question + (sx-question-get-question .site_par .id) 'focus)) + (t (sx-message + "Don't know how to open this link, please file a bug report: %s" + link) + nil)))))) ;;; Displaying |