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

Auto subscribe user to user talk sections #258

Closed
5 tasks
NovemLinguae opened this issue Feb 13, 2023 · 6 comments · Fixed by #337
Closed
5 tasks

Auto subscribe user to user talk sections #258

NovemLinguae opened this issue Feb 13, 2023 · 6 comments · Fixed by #337
Labels
C-enhancement Category: enhancement high-priority Requested by different people on different occasions

Comments

@NovemLinguae
Copy link
Member

NovemLinguae commented Feb 13, 2023

Requested by Asilvering at https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Articles_for_creation#Helper_script%3A_Add_an_option_to_disable_watchlisting_user_talk_pages

DiscussionTools has a nifty heading subscription feature, where you can click a [subscribe] feature on the top right of a heading, and then if anyone replies, you get notified in your notification tray. The benefit is that you don't have to watchlist entire pages when you just want to watch one section of a page.

Anyway, look into having AFCH auto subscribe the reviewer to user talk sections that AFCH creates. In case the new user replies and doesn't ping / doesn't know how to ping.

Implement this using the discussiontoolssubscribe API?

Discussiontoolssubscribe API is marked as internal. See also: https://phabricator.wikimedia.org/T329474

  • must be toggleable in AFCH user preferences, defaulting to off
  • implement this using discussiontoolssubscribe API
    • for accept messages
    • for decline messages
    • for reject messages
    • for comment messages
@NovemLinguae NovemLinguae added the C-enhancement Category: enhancement label Feb 13, 2023
@IngenuityWP
Copy link
Collaborator

This doesn't seem too difficult to implement, and this is a feature I've wanted for a while, so I'll try to work on this soon. Looks like after the user talk page is saved, the script should make a query to action=discussiontoolspageinfo, and use the data to subscribe to the thread. Should this also be included as an option in the AFCH preferences, so people can disable it if they don't want to be subscribed?

@primefac
Copy link

Definitely should be toggle-able; while I see this as a useful feature, I personally don't think I would use it.

@MPGuy2824
Copy link

This doesn't seem too difficult to implement, and this is a feature I've wanted for a while, so I'll try to work on this soon. Looks like after the user talk page is saved, the script should make a query to action=discussiontoolspageinfo, and use the data to subscribe to the thread. Should this also be included as an option in the AFCH preferences, so people can disable it if they don't want to be subscribed?

Or you could eliminate two steps and use https://www.mediawiki.org/w/api.php?action=help&modules=discussiontoolsedit directly

@siddharthvp
Copy link
Member

Or you could eliminate two steps and use mediawiki.org/w/api.php?action=help&modules=discussiontoolsedit directly

I'd rather not use discussiontoolsedit as posting to the user talk page is a critical function for which it's better to use the stable and longstanding core API (to which any breaking changes will be well-advertised) instead of an internal API. While discussiontoolssubscribe is also internal, it's only use will be for an optional enhancement.

@NovemLinguae
Copy link
Member Author

Example API payload, with the "token" cropped out.

commentname is in the format h-FirstCommentUsername-FirstCommentTimestamp. Username spaces are converted to underscores.

image

image

@NovemLinguae
Copy link
Member Author

Probably safest to use the discussiontoolspageinfo API to get the perfectly formatted commentname. We can iterate from the bottom up until we find a section starting with "h-". That's the section we just posted and the section that we need to subscribe to.

image

NovemLinguae added a commit to NovemLinguae/afc-helper that referenced this issue Apr 14, 2024
- lets the AFC reviewer set a preference to auto subscribe to talk page messages AFCH posts for them
- preference defaults to off
- this is for user talk messages sent via accept, decline, reject, and comment

Fixes wikimedia-gadgets#258
NovemLinguae added a commit that referenced this issue Apr 23, 2024
* auto subscribe to user talk messages

- lets the AFC reviewer set a preference to auto subscribe to talk page messages AFCH posts for them
- preference defaults to off
- this is for user talk messages sent via accept, decline, reject, and comment

Fixes #258

* comments

* create preference

* fix padding, fix linter error

* debug

* reduce code duplication

* improve html/css, begin switching to discussiontoolsedit API

* auto subscribe working now, except for an "error" in the status message

* fully working

* fix bug

* fix bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: enhancement high-priority Requested by different people on different occasions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants