Commit graph

58 commits

Author SHA1 Message Date
Stephane Bisson b3c07eedeb Remove etp_user
Target page entries used to exist for each user
that was notified for an event. They were
removed as the notifications were marked as read.

Now they remain so that the association between
pages and events can be used for moderation
regardless of the notifications read status.

This patch removes everything about
echo_target_page.etp_user from sql and php code.

Bug: T143959
Change-Id: Ib57510e6b0e9202a7e035f8ea59955dca8a0b24a
2016-09-09 09:32:28 -04:00
Stephane Bisson 6e2236db81 Moderate notifications
* When a page is deleted, moderate associated
  notifications. When it is undeleted, unmoderate.

* When a notification cannot be rendered
  (canRender() returns false), moderate it.

The biggest advantage of moderation over mark-read-and-ignore
is that those notifications are filtered out at the database
level from this point on. They are not re-processed every single
time and do not affect the number of notifications returned by
the API.

Bug: T140327
Bug: T140836
Bug: T141463
Change-Id: Idefe78408fd584c13aaa9174cee3055539d92848
2016-08-19 22:20:04 +00:00
Moriel Schottlender 5fefbe4b03 Add a rasterized email icons to Echo modules for email
Make sure we send rasterized png emails instead of SVGs in the
email formatter.

Bug: T127794
Change-Id: Ia28757bda521ec182f75458c8e52d54847d15681
2016-08-16 00:21:13 +00:00
Stephane Bisson d18750b6fb Prevent duplicate thank-you-edit notifications
Avoid duplicate by looking if the notification
already exist.

Change-Id: Ie519d13cd0ab03919f70da90d58c82a214c74b49
Depends-On: I79194c41d6b2fd84ad658909a2941d9d3d28d94e
Bug: T128249
2016-08-03 14:49:23 -04:00
WMDE-Fisch 78632108fd Echo notifications for successful mentions
Adds new notification type and icon for successful mentions.
Complements existing test to consider successful mentions.

Bug: T139623
Change-Id: I7a77b40e8b14c95cadb9023065ee916247feacf9
2016-08-01 13:40:55 +02:00
WMDE-Fisch 868190bbf6 Echo notifications for mention failures
- Adds global "$wgEchoMentionStatusNotifications"
   to activate mention status notifications.
   (must be set before extension is loaded)
 - Adds notification types and icon for some basic mention
   failures.
 - Adds failure and stats for anonymous IP.
 - Adds check for links to user subpages.
 - Adds config var for max mention notifications allowed.
 - Bundles notifications.
 - Refactors test for the event generation and adds tests
   for unknown users, user links with subpages and failures
   for too many mentions.

Bug: T136326
Change-Id: I388bdc3714feb9a2865a5ad10dbeabb0a6a09a4f
2016-07-27 13:00:25 +02:00
Stephane Bisson cf71009638 Remove deprecated formatter
Followup to I639b9d9906d3ff37021cb9b5ed3cb401354b5bd9

* Remove deprecated formatter
* Log a warning and fail gracefully
  when an event type does not support
  Echo presentation model.

Bug: T121612
Change-Id: Ic5712c4ce265b6faabce7a4028b4294fe3c73f18
2016-07-20 11:00:34 -04:00
Stephane Bisson 2f0ff9cbf6 Cleanup old notification formatting system
* Deprecated main entry-points
* Removed unused configuration
* Removed old formatters for Echo events (mention, edit-user-talk, etc)
* Removed unused messages

Bug: T121612
Change-Id: I639b9d9906d3ff37021cb9b5ed3cb401354b5bd9
2016-07-11 16:57:14 +00:00
Stephane Bisson 24caf50ff6 Dynamic bundles
To allow individual notifications to be
marked as read/unread or moderated,
bundles are created by grouping associated
notifications when they are fetched for display
instead of when they are created.

From a product perspective, this change doesn't
introduce moderation or expandable bundles but
it counts each individual notifications.
For instance, the bundled notification
"3 new topics on PageA" now counts as 3
notifications.

Bug: T93673
Bug: T120153
Change-Id: Iacd098573efd92bb1e3fcd7da4cd40cea9522f15
2016-06-27 09:49:13 -04:00
jenkins-bot 2eabf079f8 Merge "Clean up and fix updateEchoSchemaForSuppression.php" 2016-06-23 20:38:04 +00:00
jenkins-bot 13769f7584 Merge "Factor out cross-wiki API request code" 2016-06-13 11:45:09 +00:00
Roan Kattouw 05e531c7b6 Factor out cross-wiki API request code
Change-Id: Id926a607b99103d4489d1b734e00d104b7e80233
2016-06-08 22:35:57 +02:00
Roan Kattouw 4c6cadfb27 Add script to remove orphaned event rows
Bug: T136425
Change-Id: Id42a893be81176f37d9d5e3fd7e850d3a6d42e10
2016-06-07 23:34:53 +02:00
Roan Kattouw 99377e5525 Clean up and fix updateEchoSchemaForSuppression.php
This script was supposed to be run in production in 2013, but that
never happened. It was also never added to update.php.

* Use makeTitleSafe instead of newFromText, for correctness
* Fetch the columns that the update generator needs
* Replace wrapper for private method with closure
* Make the maintenance script logged

Bug: T136427
Bug: T50059
Change-Id: I6c2972120189f035483b5ca49610c008c4ba2c88
2016-06-06 23:56:28 +02:00
jenkins-bot 7c89fc0fa2 Merge "No-JS special page: One-click mark as read" 2016-06-01 18:21:56 +00:00
jenkins-bot ec34b25758 Merge "Unread pages API" 2016-05-31 18:29:07 +00:00
Matthias Mullie f751e96839 Unread pages API
The query shouldn't be too expensive: it'll use an index to narrow
down the resultset for 1 user. After that, it'll be sorted based on
a grouped by value, but that should fit in memory: it'll never be
on more than 2000 entries, which is the max amount of notifications
per user.

Change-Id: I271ea7f7a6e010284739bfce02c4ec8a077148fc
2016-05-27 17:24:53 -07:00
Matthew Flaschen 188e8d7395 No-JS special page: One-click mark as read
Bug: T136361
Change-Id: I7896dbdf25d2c1624f97777f4c8d0af41b195ef0
Depends-On: Ic31f857c749d62a32cafae68dc3f1cbd86e1e382
2016-05-27 17:23:29 -07:00
jenkins-bot 5992e88f6e Merge "Rip general cross-wiki API request helpers out of ApiEchoNotifications" 2016-05-27 00:29:50 +00:00
Matthias Mullie 6b0081fd78 Rip general cross-wiki API request helpers out of ApiEchoNotifications
They'll come in useful for other APIs as well

Change-Id: I59e508d8c2d33c3868c13e28e4ac40441bc07d4e
2016-05-26 13:51:42 -07:00
Stephane Bisson c96bc7ec38 Pagination on no-js Special:Notifications
Bug: T129169
Change-Id: I48aff35352bbda7f8818d456284c5c7adb346bb1
2016-05-23 15:39:43 -07:00
Stephane Bisson bb7a15e8be Get rid of email bundling
Bug: T135446
Change-Id: I95dc3d70c82c19d89b7a32be0c36294350d5c30d
2016-05-17 16:24:16 -04:00
Stephane Bisson 6f6e10084c HTML email formatter using presentation model
Bug: T121067
Change-Id: I77f466f0b507ffa49a9714ddba95bea8db1d8438
2016-05-12 09:29:24 -04:00
Moriel Schottlender 15a44768f4 Add mark-as-read button to notifications in Special:Notifications
Bug: T115528
Change-Id: I54dba5f86d28a069659d66dede5b7ab9981213aa
2016-05-11 10:41:32 -07:00
Kunal Mehta b6f742bc46 Add plain text email formatter
Formatters based on presentation models for
individual event emails and digest (daily, weekly)
plain text emails.

Bug: T121067
Change-Id: I4eceaf521315adab7429a8a73ffca70ebcddab86
2016-05-04 13:35:37 -04:00
Roan Kattouw 33124f35a8 Move section methods into a trait
Change-Id: Ief2005918b92945ff93aea85d17e595c7c38adf2
2016-04-28 20:52:09 +00:00
Matthew Flaschen d27f32f9b1 Unlisted special page for displaying notification configuration
This provides a simple unlisted special page,
Special:DisplayNotificationsConfiguration, to document how the
notifications are structured and configured.  It shows:

* Which types are in each category
* Which notify types (web/email) can be enabled for each category
* Which notify types are mandatory for each category
* Which notify types are enabled by default:
** For existing users
** For new users

Bug: T132127
Change-Id: I25b447a69a7c984941dfd703345d7977c0000bfe
2016-04-22 20:31:04 -07:00
jenkins-bot 523f4c4089 Merge "Run scripts/gen-autoload.php" 2016-02-13 07:25:53 +00:00
jenkins-bot 2bf38f6c37 Merge "Get rid of pre-5.4 CallbackFilterIterator implementation" 2016-02-13 07:25:50 +00:00
Kunal Mehta 3dea8578da Run scripts/gen-autoload.php
Change-Id: Ica5987ddd1e2299b1b6bb827e973f59bb28f043d
2016-02-12 14:20:24 -08:00
Kunal Mehta 92f69106cd Get rid of pre-5.4 CallbackFilterIterator implementation
Change-Id: Ie2e26eeb9d819db0353e446a7dcd87a809992d92
2016-02-12 14:20:16 -08:00
James D. Forrester 5031539327 Introduce congratulatory notifications for reaching edit thresholds
Bug: T124003
Change-Id: I21c6570e178fd03d969a516bdb31a6da9735d242
2016-02-12 14:11:21 -08:00
jenkins-bot 33fe9a0038 Merge "Cross-wiki notifications integration" 2016-01-15 01:15:42 +00:00
Roan Kattouw 63eef35026 Cross-wiki notifications integration
Bug: T121829
Change-Id: Ifb52ad5605a56d27e5951479326689242a49430e
2016-01-13 09:47:57 -08:00
Kunal Mehta 4cd9aca385 Move Notifier.php to includes/
Change-Id: Iae4ca71a5e25eb70b9fece94052b29eeb79d7a1e
2016-01-13 09:25:22 -08:00
Matthias Mullie 72f687730f Get link of LinkNormalizer
All extensions seem to have been updated to use the current formats,
so we can get rid of this tech debt.

Depends-On: I7503db28b0d81fb818b525ea9362e49b9b56342a
Change-Id: Idbcbbf95eab1172015bceea4e8124ba4c639efa8
2016-01-12 21:56:52 +00:00
Geoffrey Mon 13948c949f Replace EchoBatchRowUpdate with BatchRowUpdate
Also removes tests for the class.

Bug: T119253
Change-Id: I4c0d7187c2b847297dd0867faecba26185cfba37
Depends-On: Iccafbbdb06711463fee0f30a11326c7771df30e2
2015-12-16 16:36:59 +00:00
Stephane Bisson 04d4da2783 Presentation model for edit-user-talk
Bug: T116843
Change-Id: Ia11f5b57747ed0be5d4b00c75925d5fcdde87c43
2015-12-09 13:35:10 -05:00
Stephane Bisson a9f307ceab Presentation model for page-linked
Bug: T116843
Change-Id: Id9894b98a0dd7554a529ff763aaf0f719e36152b
2015-12-08 14:02:19 -05:00
Stephane Bisson 65638384fc Normalize links in Special:Notifications formatter
Change-Id: I35354a3b27a59ee9740c6330bb3df22a8f7d6093
2015-12-03 11:11:15 -05:00
Kunal Mehta 2892108b65 Special:Notifications formatter
I'm not really sure where to stick the primary link. I could wrap the
entire notification in a <a> tag, but all the text becomes ugly (I
suppose we could hack around it with CSS?). For now I just added it
before all the secondary links.

Change-Id: I4f6add9ecfb367660d1a6346825382ad415bdb77
2015-11-25 10:22:04 -08:00
jenkins-bot f875dfc191 Merge "Track what wikis a user has unread notifications on" 2015-11-21 00:05:44 +00:00
Kunal Mehta b85f978ddd Track what wikis a user has unread notifications on
This implements a backend layer and database storage for tracking what
wikis a user has unread notifications on. It is not yet exposed via any
API.

Whenever the notification counts on the local wiki are reset, a deferred
update is queued to also update the central database table.

Change-Id: Id1498bdeb5811d6848dc66781ffca03e726eab90
2015-11-20 15:54:11 -08:00
Matthias Mullie 0ef4df8e15 Expose more data through API
Instead of relying on the frontend to render, this enables the frontend
to do it.

The API will now accept a new format: 'model', which is basically the
presentation model's data in json format.

Some of the render code is currently only in the backend (e.g. get icon
path from icon type) so other api formats will stay available. At some
point, however, we may be able to kill those.

Bug: T115418
Change-Id: Ibc3ad54c94d6ea9bf751f3927cf69e1d062f4780
2015-11-20 19:27:34 +00:00
jenkins-bot 904e1e5a8c Merge "Presentation model for reverted" 2015-11-19 00:55:46 +00:00
Stephane Bisson 44149b6cbd Presentation model for email-user
Bug: T116843
Change-Id: I99e790d72c7c534665d1d86c38459c5d0e60b91b
2015-11-17 12:44:45 -05:00
Stephane Bisson 3fa832c6c7 Presentation model for reverted
Bug: T116843
Change-Id: Ide03220ad8ad621b5943e36d71e484a21bc8a65b
2015-11-17 10:19:15 -05:00
Moriel Schottlender 88b558f44d Add a presentation model for Echo "Welcome" notification
Bug: T116843
Change-Id: Ia43ce2c467873390c2b36439af1db8932708cda9
2015-11-02 16:02:06 -08:00
Kunal Mehta 56c4b95087 Clean up and refactor formatting system
The workflow to format a notification is
* Get EchoEvent, User, and Language
* Get EchoEventFormatter implementation for notification type
** EchoEventFormatter returns structured data about each part of the
notification (header, body, primary link, secondary link(s))
* Each output type will have a formatter class (e.g.
EchoSpecialNotificationsFormatter, EchoPlainTextEmailFormatter) which
takes a EchoEventPresentationModel and generates whatever it wants
(HTML, plain-text email, etc).

Included is an example conversion of the user-rights and mention
formatters. The previous infrastructure will remain in place for
backwards compatability until other extensions can be updated.

Bug: T107823
Change-Id: I4397872a7ec062148dfcb066ddd8ab83f40486ac
2015-10-19 10:00:23 -07:00
Kunal Mehta 35c4a37918 Use db-replicated objectcache for storing last seen time
So we're not abusing user preferences for the last seen time.
EchoSeenTime is a small wrapper around ObjectCache that handles the
fallback to user preferences during the transition.

All JavaScript code now needs to use mw.config.get('wgEchoSeenTime').

Bug: T95839
Change-Id: Ia45ba5e30eb4564250539d04d5886d2598ebd49a
2015-09-02 22:42:35 +00:00