-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Show user talk notifications #7
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
Comments
Touching a notification would open a browser |
Showing notifications would also help the user realize copyright violations (#97) they might be making. Chances are that app-only users don't read talk pages and notifications, resulting in miscommunication with the community. If I recall it correctly, one of the major concerns of the community against new mobile users was this. If some of the notifications be made directly visible in the app itself, that would be handy. As a first step, giving hyperlinks to messages readable on the website would be useful, too. See also https://www.mediawiki.org/wiki/Notifications/API . (reposted from the duplicate issue I created above) |
Great tip thanks! Do you think you could implement this? :-) We don't really need to actively listen for incoming messages real-time, I guess checking once in a while (for instance 5 seconds after the app is launched) would be enough. |
A great implementation of this would show not only "Someone edited your userpage" but instead would show the message they received. This is not easy, because such message often include templates. Here is an example I received recently:
We have several options:
|
A few points of discussion:
|
About (1): It would already be wonderful if we could just get the alerts that can be seen at your https://commons.wikimedia.org/wiki/Special:Notifications either via API or scraping. Example: |
Nice, sounds like a plan! Will have to check and see if the API linked by @whym is able to display all of that, though. |
This has been included in the IEG renewal and will be implemented in the near future. I am fleshing out the details for the task below, feedback/suggestions welcome. Use case: Scope:
|
From experience: This won't be enough. There will be uses that start the app once and have it running "forever". You might also want to investigate if you can "piggyback" these calls on other requests that are already done. Some APIs allow to request two types ob objects at the same time, so you could e.g. get all uploads and notifications with one request. |
I agree @janpio about refreshing notification by events.
I think user might want to make requested changes by WebView or app. We should give two buttons to redirect to our MediaDetail view or WebView. A question: Did we ever considered to add "delete" option like modify option? |
@janpio Good point, we should check onResume as well, at least. I've modified the scope with that. I'm on the fence re: checking with other events like picture uploads - depends on how much complexity it would add to the feature I guess. @neslihanturan AFAIK deletion in Commons is not as straightforward as modifications - I don't think anyone can straight up delete their images, they have to nominate them for deletion. We could add a "nominate for deletion" option, though. Both modifications and deletion nominations would be a future addition I think, as we might not have time for that in this round. Allowing the user to make changes to category/desc/etc in-app is planned for the 2018 WMCZ round #865 |
Great job @neslihanturan ! Looks good to me. :) |
I was in the process of implementing this for our app. The progress on this task is that I am able to successfully fetch the notifications using media wiki APIs. The MediaWiki notifications API gives all the notifications for a selected wiki/list of wikis.
And this is how it shows in my web browser, which suggests a lot of stitching needs to be done by the client. Try out the API in sandbox. |
The welcome notification that you took as an example probably does not contain much, indeed. Someone nominated one of my uploads for deletion: Someone thanked me for an edit (such as selecting categories) or for an upload: In both cases I am pretty sure we have a way to get the identifier of the image in question. |
Glancing at the list of notification types - https://www.mediawiki.org/wiki/Help:Notifications/Notifications_types , my vote would be for: At minimum:
Nice to have:
|
Cool thanks @misaochan. I will add support for the above types. I found an interesting bug while implementing this feature. If i do a fresh login and try to check the notifications, I am able to fetch it using the media wiki api. |
Heres the complete list of notifications supported by commons. https://commons.wikimedia.beta.wmflabs.org/wiki/Special:DisplayNotificationsConfiguration |
Copied over from #1089 : Changes needed before this feature is release-ready:
Things that will need to be discussed further:
|
I agree with all bullets except
I think it can be nice to see thanks notifications also. To make sure the file is uploaded to commons server. |
Is there a way to filter these specific thanks? Or to only show thanks that are related to an upload rather than an edit? |
Thanks for the PRs @maskaravivek , we have now fixed Requirement 1 and 2. What are the issues preventing 3 and 4 that you mentioned in our conversation? |
The notifications API doesn't contain any information that i can possibly use to show that the talk message is actually about an image being nominated for deletion. The API response contains the following data for the image being nominated for deletion message. Notification as seen on Commons: API Response for the same notification:
So it won't be possible to show what the message is about if we continue using the Mediawiki API. At the same time i am not sure how feasible is the scrapping option. Moreover apart from this talk message I received another notification which displays as shown below on Commons website. For this notification I have sufficient information to display. The API response contains the following:
And the app displays this notification as below: Is deletion request different from image getting nominated for deletion? |
Also for point number (4) the API doesn't return sufficient information. This is the response I receive:
So it won't be possible to redirect the user to the message section. I can at best simply construct the talk page URL. It would be great if someone could provide some insights on the issues (3) and (4). |
Regarding detecting deletion requests, some pattern matching might work well enough. In the API response (at least one used in MediaWiki itself) we have relevant URLs. "primary" attribute under "links" contain the section name - you can look for the string "Notification_about_possible_deletion" here. And "secondary" contains the relevant diff URLs and if you retrieve the contents of diff, you can look for: Regular deletion candidate (using the "Idw" template) - example: https://commons.wikimedia.org/w/index.php?title=User_talk:Kglive&diff=261848528&oldid=254797499 Speedy deletion candidate (using the "Copyvionote" template) - example: https://commons.wikimedia.org/w/index.php?title=User_talk:Kglive&diff=prev&oldid=236984458 There might be other variations of deletion request messages, but I believe these two are the most common ones. The api query above was sent by MediaWiki, https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=query&format=json&formatversion=2&meta=notifications¬sections=alert¬format=model¬limit=25¬prop=list%7Ccount%7CseenTime&uselang=en¬crosswikisummary=1¬unreadfirst=1¬bundle=1&_=1519689342745 - is this the same endpoint the app is using, right? |
Thanks for the tip @whym! I wasn't sending some of these query params so the response that I got didn't contain all this information. I will incorporate these changes. |
@nicolas-raoul It is possible to just get the alerts as you commented above from the notifications API. Do we want to show just the alerts, or all notifications? |
@nicolas-raoul One difference that I noticed is that when I add a parameter to fetch just the alerts, then the |
How about fetching everything, and then filtering out the |
Yes, thats entirely possible. Will make this change in my PR. |
Fix anchor link for grey section
Added setOffscreenPageLimit in ViewPager
Notify when a user talk message is received, or when a picture is nominated for deletion or modified etc
This is important so that users get notified of feedback like "Please don't upload pictures of recent copyrighted paintings" or "Where was picture X taken?" or "Please categorize using X rather than Y" or "Please provide better description".
The text was updated successfully, but these errors were encountered: