Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open links for inbox items #347

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion sx-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,12 @@ likes."
(sx-question-get-from-comment .site_par .comment_id) 'focus)
(sx--find-in-buffer 'comment .comment_id))
(.notification_type
(sx-message "Viewing notifications is not yet implemented"))
; (sx-message "Viewing notifications is not yet implemented"))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably just delete this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it in because what I did wasn't really a solution for the lack of implementation, but rather a stop-gap to give the user the ability to continue using stackexchange in another interface (the web browser). Whenever sx.el does implement support for those type of pages, it would be appropriate to remove my code snippet, but for now a user has no way to perform the tasks associated with the notification, eg. review someone's suggested edits.

(let ((start 0))
(while (string-match "\\(http[^\"]+\\)\"" .body start)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this wrapped in a loop? Do we want to get the last link in body? What links come before it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My observation of the notifications in my own inbox was that when there is more than one link, the first is to a general item, such as a question or answer, and the second is to an action url, such as a page to review someone's edit to your question/answer.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we should just start the search from the bottom, then.

(setq .link (match-string 1 .body))
(setq start (match-end 0))))
(browse-url .link))
(.item_type (sx-open-link .link)))))

(defun sx-display-question (&optional data focus window)
Expand Down