Commit graph

57 commits

Author SHA1 Message Date
jenkins-bot 124cbbd036 Merge "Auto mark notification as read if it doesn't have target page" 2014-08-15 18:35:27 +00:00
bsitu 1cc0f83829 Move 'notification count refresh' logic out of mapper
Change-Id: I4c10b66e537dea5f9c5bc7ccba8f558cafd103d7
2014-08-15 16:02:23 +02:00
bsitu 61fea56641 Create TargetPage data if specified by EchoEvent
Change-Id: I71039eb03b4b7e617ce03d515a6d51c4f3666ab8
2014-08-15 00:16:41 +00:00
bsitu 7be9d68219 Auto mark notification as read if it doesn't have target page
The special page will now not auto mark a notification as read if
it has a target url. Currently no notifications have target urls
but this will be changed in a later patch...

Change-Id: I9bd71d59391189d5d761ab5f1c84af0bc3554be0
2014-08-15 00:11:57 +00:00
bsitu 029668423d Add TargetPage model and mapper to notifications
This will be used for marking a notificaiton as read when
a user visits a target page. The new table should keep the
volume as low as possible for fast data loopup. records
should be removed from the table once it's marked as read.

Change-Id: I605cbc79adfc12d22bd889c5bb513d05c479fe6e
2014-08-13 00:48:07 +00:00
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
bsitu 427b7e2c38 Add support for splitting notifications into alert & message
Change-Id: I8eeeeb9a7a1539a258bc42584274897f9e7dc775
2014-08-05 14:50:54 -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
Kunal Mehta f551656aa2 Remove EchoEvent::updateExtra, MWEchoBackend::updateEventExtra
Unused functions.
There is also no usecase for this, events shouldn't be altered
after creation except for bundling.

Change-Id: Id175c075d24263119f0455d99342263dd98f9410
2014-07-13 22:53:57 +00:00
Thiemo Mättig e205992d0b Remove unused code and fix missing/broken documentation
General code cleanup as reported by the PHPStorm static code
analysis. I hope it's not a problem that I made a lot of very
different (but all very tiny) changes in a single patch. If you
want to merge this but you think it's better to split it into
several patches first, please tell me.

Change-Id: I2e2c4bb47f8d20e038d28e236e2ff813b30504af
2014-06-04 04:54:00 +00:00
Kunal Mehta 5e5993431b Fix incorrect usage of Title::newFromText
Change-Id: Icc69e47eae59653e4d8c3b227cccb7ea046e521b
2014-04-12 21:18:52 +00:00
jenkins-bot 48bd44a238 Merge "Add public setters for EchoEvent attributes" 2014-03-01 17:08:08 +00:00
Matthias Mullie b0c4e551fd Add some more clarification on why event_extra can't be too large
Change-Id: I3b366e06bb1980d834cad09c24dde929981ea366
2014-02-05 14:21:48 -08:00
bsitu 64afd78cbe Prevent events with large blob extra data
Change-Id: I8300abd3adeef863d181566072ab4163d1f0bcf3
2014-02-05 12:20:04 -08:00
Kunal Mehta fbd127fc88 Add public setters for EchoEvent attributes
So extensions can modify an event, like bug 57234.

Change-Id: I60b61d635eb3ab033dc9cc8d8bbf751e2221acc8
2013-11-29 22:20:03 -08:00
Kunal Mehta 2cc6171860 Add hooks for EchoEvent's
BeforeEchoEventInsert can be used to abort or modify an
EchoEvent before it is created. If aborted, EchoEvent::create
will return false.
EchoEventInsertComplete can be used to run stuff once it's
been created.

Change-Id: I376708ac7aafc419bf87bceeff6de7de9bdc2f4e
2013-09-30 13:21:56 -07:00
bsitu bca96e30ed Attempt to fix 'welcome notification' exception
It throws very randomly in job queue for enwiki, about 15 exceptions in 4 hours

Bug: 53425 

Change-Id: I1d7e45e33ffb8df1a91183e263daf007b0affc7f
2013-08-27 23:16:46 +00:00
bsitu 272b5bd50a Add replication delay handling to page-link formatter
If the job queue is not enabled to process web and email notifications,
there may be a replication delay in brand new link-from-page

Change-Id: I6e36e3fd015a582f4e85709282bdb70033fd1776
2013-08-22 15:21:52 -07: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
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
Erik Bernhardson 34fbeaf8c9 Respect revision suppression within Echo
Update the echo formatter to properly display suppressed revision content

Bug: 48059
Change-Id: Iee3c9a41ad24c66b0e2abdd5f1375ebdbd74314e
2013-06-18 11:00:50 -07:00
jenkins-bot fea4484b68 Merge "Database updates for respecting oversight within Echo" 2013-06-11 00:01:02 +00:00
Erik Bernhardson f38ce97efd Database updates for respecting oversight within Echo
Provides the first step of adding and populating a new database field
for Echo oversight deployment.  The new field is populated via a
maintenance script and Event::loadFromRow will accept both new and old
results.  Everything will still run when the 2 now unused fields are
later dropped from the db.

Bug: 48059
Change-Id: I24d4b61a061f94ed9aaaa6087f33b2ab37f773cd
2013-06-10 14:52:18 -07:00
bsitu 71f250e0c6 (bug 47912) Visiting talk page should mark talk notif as read
This needs some more manual testing and adding unit testing

Change-Id: Iadfe3cf7927d5318f89ba17f067000f9399060af
2013-05-29 20:43:57 -07:00
bsitu e50f5a55a6 (bug 48821) Echo badge count always lags by 1
This bug was introduced during fixing the implicit database transaction,
the badge count logic happens before the transaction completes on idle,
moving the badge count code to only after a successful notification creation
should solve the issue

Change-Id: Ia564ed0d386e7cf2da1af3d23ae83d71ad472df5
2013-05-25 19:44:09 -07:00
bsitu 617488526b (bug 44247) Do not write to storage if read-only mode is on
Change-Id: I2e41cef0b5952c43cbba3374ac4da431b81c18ba
2013-05-14 13:48:05 -07:00
bsitu a98aaacf38 Add nextSequenceValue() to support dbs like PostGres
Change-Id: I7af8391fc88d0336b83dba449f52709f309b6833
2013-04-17 13:58:13 -07:00
bsitu 6a3624b0e4 Add web bundling function to Echo notification
* add web bundling feature
* unify event_timestamp with notification_timestamp
* remove echo_subscription
* update article_link to page_link notification with new logic
* remove duplicated function from MWDbEchoEmailBatch since it's defined in parent class

Change-Id: I2fa91c44edb020209b468fe13f894d9db3732e69
2013-04-04 10:53:46 -07:00
bsitu 8a02df15c5 Some cleanup to Formatter
* Move dismiss checking logic to event
* Remove unnecessary variables

Change-Id: If224fe6d668788e779109ee96ac28d44faa4b41b
2013-04-02 16:51:14 -07:00
Kaldari 9881a2a1ba Merge "Add more documentation and getter method to Notification" 2013-03-21 08:10:57 +00:00
bsitu 5c701f80ef Add getCategory() method to event object
Since every event is tied to a category, it's better for event object to have it as a member method

Change-Id: I911415284486bb11d13d91366340c5c330317c34
2013-03-18 16:30:39 -07:00
bsitu 9b1b6b09f1 Keep instance variable 'type' the same visibility as the others
1. Keep it as protected like the rest of the variables and there is an accessor method getType() for external access

2. Add some more documentation

Change-Id: I26b20e6b211a7dbfa96cf57eb87621698015646e
2013-03-14 12:14:43 -07:00
Kaldari 8357f4bd75 Implementing new prefs system for Echo
Change-Id: Id745ed6cf1c92695569597fab6ea662bac8c76c0
2013-03-05 12:20:17 -08:00
bsitu 605c88b4bb Add more documentation and getter method to Notification
Change-Id: Idb64de7034e7ff3c615dcee6fe814d64102f66cc
2013-03-04 17:34:23 -08:00
jenkins-bot 95f1d50c18 Merge "Add first version of EventLogging schema to Echo" 2013-03-03 03:45:46 +00:00
bsitu fc5c341692 Add first version of EventLogging schema to Echo
Change-Id: I4b6033ffc2ec8d1597f2b447f100c58a8c3a7f3e
2013-03-01 15:53:07 -08:00
Reedy 62a433573f Numerous bits of method parameter documentation
Change-Id: Ie4b2657b5e010311b779aa587aa7fa9fc3f19abb
2013-03-01 10:56:58 -08:00
Kaldari af06e26de6 Adding dismiss functionality to special page
Includes new web preferences for Echo

Also adding ability to set dismissability per notification type

Still need to arrange subscription options into a friendly format

Still need to add dismiss functionality to flyout

Change-Id: I484a24b424e69be3640e63b76f82735edae6f13a
2013-02-12 11:33:50 -08:00
bsitu 78ad57d43a Abstracting MySQL in Echo so storage type can be swapped easily
Patch Set 6:
	* remove redundant JobQueueDB because it's the default
	* remove extra ;

Change-Id: I25dc0203ed5be1e4989242a87f4fde9c8799de28
2013-02-08 10:34:50 -08:00
bsitu 961f86bd33 add article-linked notification
Patch Set 6:
	1. use 'linked' icron
	2. update message from cross-referenced to cross referenced

Change-Id: I8c70454e59b5f9f86f92825cfc75dcf5d9bcb336
2013-01-02 10:40:39 -08:00
bsitu 2cec5ca045 Temporarily bypass job queue for notification
It takes more than an hour for the job queue to run in mediawiki.org and this is not acceptable for the purpose of testing a notification.

Change-Id: I87aaeaafdaec1896123acfc7e3a3ef5945207509
2012-12-19 12:37:02 -08:00
bsitu 6b8571403a Initial check-in for email batch
patch set 3:
	* add gender support to various messages
	* tweak variables a little bit, e.g. move class variables to function local variables
patch set 4:
	* update various email to e-mail in i18n file
	* add support to process only valid echo events
	* add global email footer
	* add the new table schema to core schema file
patch set 5:
	* remove trailing white space
	* add missing semicolon to return statement in Notifier::notifyWithEmail()
patch set 8:
	* some change based on newest feature requirement

Change-Id: I3298617dab4c04c4d6d486469120fc2d0c986b66
2012-12-12 12:00:13 -08:00
bsitu cd349b11ac (bug 41866) Fix invalid notification in the flyout and page
1. Skip invalid notification events
2. Add formatting to notifcation count, for example, if the count is over 99, we just show 99+

patch set 2:
	* fix trailing whitespace
patch set 3:
	* remove extra whitespace and indentation
patch set 4:
	* change function name from gatherValidEchoEvent() to gatherValidEchoEvents()
	* add more descriptive documentation

Change-Id: I81a135c24f64fa1aace4dd2631e9b88bbe22d3d0
2012-12-03 11:41:16 -08:00
Kaldari 1c2a76ae22 Adding comments and fixing some incorrect comments
Change-Id: Iab1be6ad8700630f2cf3f97b5d5edd542f1c85ec
2012-11-26 18:20:53 -08:00
Reedy 962d312080 Fatal error: Call to a member function equals() on a non-object
Fatal error:  Call to a member function equals() on a non-object in /usr/local/apache/common-local/php-1.21wmf4/extensions/Echo/formatters/CommentFormatter.php on line 28

Change-Id: If6867aeb0b4c3f6b4229f748e9791f3e74a4ef87
2012-11-14 21:52:17 +00:00
bsitu 26110aa080 Improve Echo Hooks
BeforeFormatEchoNotification and BeforeCreateEchoEvent Hooks would be executed multiple times because

	* An action may fire multiple notification events
	* The notification flyout and page have multiple notifications

we only want these hooks to run once to gather valid formatter and event

Change-Id: Ifff0ad34f3c44c31d88f982fd110ad3399ff5bd0
2012-11-01 15:59:47 -07:00
bsitu 5bf61444bc Add some useful hooks to Echo extension
patch set 2: update hook name from BeforeformatEchoNotification to BeforeFormatEchoNotification

Change-Id: I2286b72b0d5c8a562c47a0bad6ceeee429a9447b
2012-10-22 16:45:11 -07:00
Siebrand Mazeland 69d91fa1b6 Update documentation and deprecated methods.
Basically having fun with the code analyzer.

Also:
* remove unused local variable assignments
* missing return values
* CSS optimizations.
* Initialize possible unset variables.

Change-Id: I77aa08ecb48eeda08f14dc38d7f35d57ea9fa110
2012-09-02 11:30:38 +02:00
Siebrand Mazeland 950f74eba8 Follow-up I2c10cb69: Auto-formatted using IDE.
Change-Id: Iedeaca3c31195a5cf7df8dd38d6332cfabffcc67
2012-08-31 23:50:46 +02:00