Commit graph

184 commits

Author SHA1 Message Date
bsitu 4bf88aa741 Hygiene: Add abstract model and mapper for notification
* Shared function can be put in the abstract class and this also enforces some interface methods 

* Initialize a default dbFactory when it's not passed to the mapper

Change-Id: I1033dafaa90a1f683fbe9ad69bed04f4844e357b
2014-08-13 00:11:15 +00:00
jdlrobson 8d12ef9a80 The first ever Echo QUnit tests
Also change coding conventions of Resources to allows use
array for scripts key.

Change-Id: I0c9f358ce3eb62adb07b68623e97c07993c9c45c
2014-08-06 13:26:42 -07:00
bsitu 427b7e2c38 Add support for splitting notifications into alert & message
Change-Id: I8eeeeb9a7a1539a258bc42584274897f9e7dc775
2014-08-05 14:50:54 -07:00
bsitu 4e63ee6164 Hygiene: Update method documentation & split exception to a file
Change-Id: Id77db0f21ee3fdaad4e040c853fadc605df212ea
2014-08-04 17:43:57 -07:00
Erik Bernhardson 74a56e6fc4 Convert existing notifications to use user-locators
Replace implementation specific code with generalized user-locator
implementations that can be re-used by more notifications in other
extensions.

This patch adjusts the `user-locators` notification parameter to allow
arrays which facilitate passing options to the locator.

Previously(still works):

    'user-locators' => array( 'foo', 'bar' ),

New functionality:

    'user-locators' => array(
	'foo',
	array( 'bar', 42 )
    )

In the second example the callback specified by `bar` will receive
an EchoEvent as the first argument and array( 42 ) as its second
argument.

Change-Id: I7305279bc91d1e40e7054e2fd42a819a35526b82
2014-08-04 11:16:34 -07:00
jenkins-bot cf418a4ecb Merge "Generalize a couple implementations of EchoGetDefaultNotifiedUsers" 2014-08-02 00:10:42 +00:00
Erik Bernhardson 71c7e02858 Directory reshuffle, add dev tools
* Port Flow Makefile to Echo
* Move resources to Resources.php

Change-Id: I75e96cc1e51a7768600ffc083550fc94ea9d1e6c
2014-08-01 22:38:41 +00:00
Erik Bernhardson f995de90c8 Generalize a couple implementations of EchoGetDefaultNotifiedUsers
There are a variety of generic strategies you could define to choose
which users should be notified about an event, such as 'users watching
the title' or 'talk page owner' (User_talk only).

This adds a new way to generically implement these in Echo and expose them
to other extensions rather than having each extension implement these
generic strategies themselves.

This patch only converts one notification, edit-user-talk. The remaining
notifications will be converted in future patches. The first user of this
will be Flow for notifying all users watching a particular talk page in
I4e46a9c003fbdde274b20ac7aef8455eab4a5222

The users watching title implementation provided here is minimalist, a larger
refactor to accomidate pages with thousands of watchers is being handled
in I3d3fa9328f348bb48682d3658622952ce82d3925

Change-Id: I19bb6a794d22565f3bb5421de92426d390197796
2014-08-01 12:31:53 -07:00
bsitu 267a56398e Introduce AttributeManager class
This is a precursor to splitting notifications into
alert and message sections.

Change-Id: Ic685f7026ab9b41407b51317780bbfadd05bf9f1
2014-07-31 11:41:00 -07:00
bsitu d3d99772b9 Replace EchoBackend with mappers and gateway
* Get rid of EchoBackend by separating responsibilities into smaller objects

* Move main fetchNotification logic from API to a more appropriate place

* Add more unit testing coverage

Change-Id: I42f4d7566543332588431c21c220c0d64d026b70
2014-07-31 10:29:52 -07:00
Max Semenik 1dd635a773 Add ParserTestTables hook handler
Otherwise, it explodes when trying to run tests via PHPUnit:
Error: 1146 Table 'osmiumwiki.parsertest_echo_notification' doesn't exist (localhost)

Change-Id: I8a3e0171ab022e8e2973ea8bed9aacba73a35f34
2014-06-25 18:06:09 -07:00
Kunal Mehta e4f97802db Split user rights changes into their own category
This will allow users to disable them if they wish to.
By default, both web and email are enabled for all users, which
is the current default.

This also fixes a bug in the EventLogging portion where user rights
changes would be logged with a user id of -1, instead of the
actual user.

Bug: 55337
Change-Id: I026b9392b085e295fbcd375095c9aed682fc29a2
2014-06-15 18:39:23 -07:00
Siebrand Mazeland 0730ff8d67 Migrate to JSON i18n
Procedure per https://www.mediawiki.org/wiki/Manual:GenerateJsonI18n.php
with shim.

Change-Id: I45c23439d25b081d932ff4354fd3308122e5b186
2014-03-26 15:22:57 +01:00
bsitu bc57eb7535 Prevent double email notifications on talk page edit
If a user is watching his/her own talk, an edit to the talk page
may trigger an echo notification and watchlist notification.  We
only want to send one of them

Depends on core patch: https://gerrit.wikimedia.org/r/#/c/114682/

Bug: 53569
Change-Id: Ib1bb71e047789d3a857f028aaa45384022bb35c7
2014-03-14 14:05:49 +00:00
Kunal Mehta 1ea7332cc1 Remove dependence upon $wgPasswordSenderName
Fallback to 'emailsender' message if not set

Change-Id: Id136692b80b7582a515501672259394e8db74112
Follows-Up: Id20e4ec1cdae94fadb278146cd72d5a9b247dccf
2014-02-24 22:09:27 -08:00
Ori Livneh 761f3e5664 Update Schema:Echo revision to r7572295
Removes the enum constraint from the notificationType property.

Bug: 61698
Change-Id: I84e8f874ea730eb65151dd011274b3ff0376bf25
2014-02-20 14:40:34 -08:00
Matthew Flaschen d889fd6cc6 Use mediawiki.ui.button instead of mediaiki.ui
* 9e4e58bce8d10f65cf298b39f48e86c41b6a82b8 separated mediawiki.ui.button
  into a separate module (for modularity, and potentially to allow
  wiki content to use mw.ui buttons by default in the future).
* Currently, the button code is in both mediawiki.ui and
  mediawiki.ui.button for backwards compatibility.  However, it will be
  removed from mediawiki.ui when existing uses transition over.
* Echo does not use any mw.ui features other than buttons.

Change-Id: I429d8f2424d6218439eed01fe5ea6497e7697ba2
2014-02-04 21:07:52 -05:00
Kunal Mehta 1240492018 Add new messages indicator from a hook
So it works for users without JavaScript

Bug: 56974
Change-Id: I0652a740ca7156257d4459931d80872877339c0d
2014-01-12 03:31:46 +00:00
theopolisme fc7e18ba8e Mention: notify correctly if there is no section title
If a user is mentioned in an area that does not have a section
title (for example, the lead section of a talk page), use the new
'notification-mention-nosection' message, to avoid an awkward and
incorrect "[[Page#|]]".

Bug: 52507
Change-Id: I40628b76c460c79008053222c9780bb23549731d
2013-11-22 21:31:45 -06:00
Timo Tijhof c1f022ecae Remove exclusive module group to reduce HTTP request fragmentation
Cache groups should only be used when it is worth to have the
module(s) in a separate request. Echo is relatively small and
stable in terms of cache combination, not worth it to force
its modules to be in a separate http request as all other modules.

Change-Id: I198b5664d662c93c593d048efcfaf4aac765a6b9
2013-11-07 23:16:44 +00:00
jenkins-bot af3d8c30eb Merge "ext.echo.alert: Restore orange background on Monobook" 2013-11-02 23:27:59 +00:00
jenkins-bot a1388d0096 Merge "Remove class constant variable reference from Echo.php" 2013-10-29 05:10:07 +00:00
MatmaRex dc1443f57f ext.echo.alert: Restore orange background on Monobook
Core styles for Monobook include high-specificity background: transparent;
rule for #p-personal li a, we need to match it to set our background.

Also change hover behavior: switch to a deeper orange instead of
default white, similarly to how the badge already behaves.

Partially reverts I682182fe.

Bug: 56214
Change-Id: I9f343264c395ecf09c1e34e03d208ec2119fb622
2013-10-27 15:30:22 +01:00
jenkins-bot fc41b4a613 Merge "Update to latest revision of Echo schema" 2013-10-25 05:41:22 +00:00
Kunal Mehta 18b09b5daa Update to latest revision of Echo schema
This patch updates Echo to revision 6081131 of Schema:Echo, adding a 'rev_id'
field and the code to populate it. The patch also increments the logging
version identifier to 1.5.

Bug: 46045
Change-Id: I4ac1a25c306b0e0983a3490a29fe3dc4aa4bfc6f
2013-10-25 05:40:05 +00:00
bsitu 71e27f4b7a Remove class constant variable reference from Echo.php
This is causing fatal error in update.php

bug: 55469
Change-Id: Ib0a354addd44542f7ec4eda427c0b530f33e6c12
2013-10-23 12:31:35 -07:00
Kunal Mehta 790f4bee9e Remove "Talk:" prefix from "You have new messages"
Bug: 49324
Change-Id: I51d9fc5c891d4489fcb5bce74b0428575f1df7f6
2013-10-21 11:56:20 -07:00
Ebrahim Byagowi 88937d21c1 Native digits on 'mw-echo-overlay-title-text'
Change-Id: Icdd52ea0267ffbaa0e103070655735eff8423ca1
2013-10-13 19:34:03 +00:00
bsitu 3b3ed1e3bc Fix some notification badge related issue
* In some languages like persian, the number 0 is represented as '.', we can't compare
  '.' with either 0 or '0' to detect the no-notification status of the badge

* The markread API doesn't respect uselang param, it would return 0 instead of . in a url with uselang=fa

Note: we need to provide raw and formatted count in the API since client side javascript
      doesn't provide fancy function like $wgLang->formatNum()

bug: 54575

Change-Id: I0a49828253ec346ed27c5b9a976f8bdff4e1fa90
2013-10-02 11:25:05 -07:00
kaldari 4380e81afe Moving dependencies from ext.echo.base to more specific modules
mediawiki.api and mediawiki.Uri are desktop-only modules that are
not actually needed by ext.echo.base. Moving the dependency
declarations to more specific modules so that ext.echo.base is
usable by mobile notifications. ResourceLoader is smart enough to
not double-load them, so there should be no performance difference.

Also removing unused 'cancel' message.

Change-Id: I9fa8c4501e038ded9125c3b43e5207c355af2db9
2013-09-25 17:58:11 +00:00
kaldari 08fc83b6de Cleaning up Echo 'base' module.
Removing unused functions and declaring correct dependencies.

Targetting to desktop and mobile so it can be used by both.

Also removing dismiss-related code from the formatter.

Change-Id: Icccce64cfb3c564ab468a93ccdba9c5a61687fd5
2013-09-23 11:29:49 -07:00
bsitu 2b57fbd3c2 Split the Echo API into their own write/read APIs
Change-Id: I0ab85c91c6fbe17e9a1c7dc9e504980f629a5065
2013-09-18 14:28:41 -07:00
bsitu 06e7317472 Archive page and overlay should respect ?uselang=xxx
In addition, any message used in the email should be
sent in the user's language.

Bug: 52992
Change-Id: I3585f28d4ec97b86a467958bdfd603791f293d52
2013-09-09 13:44:05 -07:00
jenkins-bot 8df26c9386 Merge "Updating eventlogging schema revision number for mobile data" 2013-09-05 01:47:23 +00:00
jenkins-bot 1bb1e9ff73 Merge "Remove Echo preference change eventlogging" 2013-09-04 18:09:58 +00:00
kaldari 9793138d4f Updating eventlogging schema revision number for mobile data
Change-Id: I28b5c9bda0a97ec69d10dd24e4345b8bd1363899
2013-09-04 11:03:06 -07:00
kaldari dc46848c5e Updating headers in Echo.php
Change-Id: I05b20f59cff94185a91c7f6e5f1f52dc034eafb4
2013-08-28 10:38:52 -07:00
bsitu 08e2dd4ddb user-rights notification primary link has incorrect message key
The current message key is notification-learn-more, but this message key
is not defined in the language file, it should be echo-learn-more

Change-Id: I4e2f19e3663727ff8c4083fd295c80cb350297c4
2013-07-31 17:18:23 -07:00
bsitu 0b1275b9e3 user talk and mention notification improvement
http://www.mediawiki.org/wiki/Echo_%28Notifications%29/Feature_requirements#Improved_Notification_Structure

Change-Id: I2da35e8ed092c42ac95ae34012426834a37c3cde
2013-07-29 18:07:43 -07:00
bsitu 7f33cc98fa (bug 46665) Add HTML email support to email digest
Change-Id: I3b881acbcf4b18fc0401364ea0a6bc993d2c2246
2013-07-23 13:20:33 +02:00
bsitu 2c74f66f18 Add HTML email support to Echo notification
To test the HTML email:

1. install the latest version of php-mail and php-mail-mime package, they are required
   by the core sendmail function to send HTML email
2. set $wgAllowHTMLEmail = true before loading Echo in LocalSetting.php

Change-Id: Ia4b98b14e135742b84f1b0e04589b0efdd24e954
2013-07-23 13:20:33 +02:00
Timo Tijhof ede11477ee Remove inappropiate executable flag on Echo.php and echo.sql
Reverts this part of f38ce97.

Change-Id: Id6339b9178814cae161ce4dac8c44a3b218ea58e
2013-07-18 17:19:05 +02:00
kaldari e8df780d9a Remove the feedback link from the flyout - no longer needed
Change-Id: I0531fdd126c3030097b5485b1140c66fc6306ae0
2013-07-06 00:48:29 +00:00
bsitu 0cb48219cc Remove Echo preference change eventlogging
Echo preference change is already captured in the general
preference change eventlogging, this is just a duplicate

Change-Id: I49cd2ad5776a670e2cd28414e156f5201087ded0
2013-07-03 11:55:44 -07:00
bsitu f9a5cc717f Add difflink to mention email notification
Change-Id: I521ff0387dc7079ebf0c7f58a34d799673833b7c
2013-07-01 14:42:19 -07:00
kaldari 972e14672f New primary and secondary link behavior for Echo
See https://www.mediawiki.org/wiki/Echo/Feature_requirements#Flyout
and https://www.mediawiki.org/wiki/Echo/Feature_requirements#HTML_single_email_notifications

Also includes some related style changes per Vibha

Also removing feedback link from overlay since it's no longer needed

Change-Id: I94aed697e87126ed8ad6d1d416c99bafaa53ac53
2013-06-27 16:12:16 -07:00
jenkins-bot f069514830 Merge "Adding diff link to talk page notifications for email" 2013-06-27 17:53:22 +00:00
Krenair 7da252eec4 Use mediawiki.api instead of $.ajax
Change-Id: Iea98b6cb338c8b7ebbf244073bb8fe481e5e7655
2013-06-19 21:31:38 +01:00
kaldari d43e19cb51 Adding diff link to talk page notifications for email
We'll also be adding diff links for the flyout and archive, but
not in this change.

Bug: 48183
Change-Id: Iacd269a489c93b4fc4d28306915658fad372f50d
2013-06-12 23:36:07 -07:00
kaldari 1bfe147708 Preventing FOUC on Special:Notifications page
To prevent flash of unstyled content.

Bug: 49496
Change-Id: I6a7bf510256a84ef7ad0ec9cd03d1ccae1fe149c
2013-06-12 14:10:56 -07:00