Commit graph

134 commits

Author SHA1 Message Date
bsitu 1270da19e8 [2] Add title local cache holder objects
Core titleCache doesn't do what I expect it to do, issuing
Title::newFromId( 1 ) mulitple times would issue multiple
idential queries to the database. It doesn't return what's
already in the cache.

The goal of this patch is to batch load titles via newFromIDs,
and save the number of mysql queries

Change-Id: I8fe767ac2669e67bdf7d17eecccfc0dcb6b5fc7d
2014-08-18 13:52:40 -07:00
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 cac4050990 Mark notification as read upon visiting a page
Change-Id: I84493fbf742acd90645d484d42f049796a5e48ee
2014-08-14 14:10:55 -07:00
jenkins-bot f001382328 Merge "Add TargetPage model and mapper to notifications" 2014-08-14 20:18:44 +00:00
bsitu ff0784e7da Add support to mark all as read for "sections"
This also updates the way how mark all as read works

Change-Id: Ifb7b1b7b7feb4a5af65c79bb16b91a5a9c70166c
2014-08-13 17:16:19 -07:00
bsitu a7fbb53584 Add method for fetching unread notifications
* This will be used for the unread notifications in message overlay

* This will be used to "mark all as read" based on sections ( event types ),
  since we can't do updateJoin.  We could set a max update limit like 3000,
  and use this to do "mark all as read", this would handle majority "mark all as read"
  use cases. This would also prevent updating big amount of data on a web request

Change-Id: I2a9103a73d0aa91a52d5c0233e946a0ef979f96d
2014-08-13 13:10:38 -07: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
Kunal Mehta 631d0252f7 Fix Echo breaking
Bug: 66992
Change-Id: I7add48c55e04ef4ea5d0f537c6a1a1ba959f628e
2014-08-08 21:35:58 +01: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
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
jenkins-bot 1ba7583985 Merge "Introduce AttributeManager class" 2014-07-31 20:45:31 +00:00
bsitu b26cc21794 static method should be declared with static
Change-Id: I855c09d950a44ae70b7d982e8c3e23b36dde1475
2014-07-31 13:10:35 -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
Aaron Schulz 16ce5baaf4 Switched from begin/commit to *Atomic methods
* This is just stylistic and cuts down on begin/commit calls in grep

Change-Id: I11011c312c91e158e0cce395eca8022535388b90
2014-06-25 11:08:48 -07: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
Quim Gil a2fbad6b6a Remove background color of footer in email notifications
Removed #F8F8F8 background color from <td>s in the footer of
Echo's email notifications, in order to highlight better the
content and minimize the importance of the footer, following
the practice of several popular sites.

Bug: 59913
Change-Id: I23d039abb701d59792c591e6847e73cdcf929705
2014-04-07 23:42:42 +00:00
Yusuke Matsubara 17fa9cadde Properly get timestamp position in DiscussionParser
The code was looking at the [0] element for the matched position
of timestamps, while preg_match returns it in the [1] element.

Bug: 53132
Change-Id: Ibfd3f2b86b007f28f73a137defb80276fb830d28
Follows-Up: I6c636b055bcd25760aee848aea71fe4044c7e1be
2014-01-30 07:28:51 +00:00
Kunal Mehta da04b97148 Allow icons to set different ltr/rtl versions
This reverts commit 9a2f96c022.

Change-Id: Iba7a15c4320cf508fd0a2436a8cfb686a54b262e
2013-12-19 15:07:26 -08:00
bsitu 9a2f96c022 Allow defining clousre for notification icon path
In some cases, we need to add wgLang->getDir() for icon patch, but
wgLang is not yet fully initialized

Bug: 58705
Change-Id: I72fcb8e4cff9437d66ff9b60669701f572060389
2013-12-19 22:29:47 +00:00
jenkins-bot 6c11bf28f7 Merge "Support non-English namespace names in DiscussionParser::getUserFromLine" 2013-12-18 01:24:30 +00:00
bsitu 18cf0985df Avoid PHP warning in strripos()
bug: 56586
Change-Id: I9c70e28ca7495893f5a34a3f5ec301815de35e2c
2013-11-05 11:03:55 -08:00
Kunal Mehta a026ba880f Fatal error: Cannot use object of type EchoEvent as array at EventLogging.php
Bug: 56521
Change-Id: I180728022886b6a2ba96b0da79299ec342547b3a
2013-11-04 20:36:34 +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
Kunal Mehta d139b75020 Fix phpdoc comments
Change-Id: I2f22838aa6c2c46fbd570b01c2fb118cd8c58790
2013-10-08 13:56:24 -07:00
Bartosz Dziewoński 3a519d5b37 Support non-English namespace names in DiscussionParser::getUserFromLine
Bug: 53132
Change-Id: I6c636b055bcd25760aee848aea71fe4044c7e1be
2013-10-03 23:08:35 +00:00
bsitu 700271500a Bundle message should show diff of all included revisions
bug: 54391
Change-Id: I6c726d9d36e87fb5092b3c3e205e10ae0de557b4
2013-10-02 16:11:11 -07:00
bsitu 23f66ec6e8 Make html email look prettier on mobile device
Add a media query style for mobile device so the email doesn't generate
a horizontal bar.  Gmail strips out all style, that means we can't apply
the mobile style to Gmail.  Luckily, Gmail on mobile device browser
automatically fit into the entire mobile screen

bug: 53057

Change-Id: Ia4350669db2e81ee44d5b53d7cece6fcd8839e7a
2013-09-20 10:48:37 -07:00
bsitu 67959e65d2 Fix some RTL issue and add sans-serif as fallback font
bug: 54249
Change-Id: I8b0d259922680fa026969ebd81cdd62b718811c9
2013-09-20 00:55:57 +00:00
jenkins-bot 1bb1e9ff73 Merge "Remove Echo preference change eventlogging" 2013-09-04 18:09:58 +00:00
kaldari a4b62d8d82 Fixing More... button so it doesn't always skip a notification
Bug: 53718

Change-Id: I021580b740b90772c98d32850f5f1a2521bd1a14
2013-09-03 11:51:35 -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
Yuki Shira 32087f7605 Add full-stops & fix quotation marks
Spotted by Siebrand
http://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Echo-email-footer-default-html/en
http://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Echo-email-batch-body-intro-daily/en
http://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Echo-email-batch-body-intro-weekly/en
http://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Notification-mention/en

Change-Id: Ia1c61c4f78f7b93343ba1174b7446829c216cbfa
2013-08-02 08:05:59 +09:00
bsitu a0902ceca8 (bug 52313) Do not show text snippet with undecoded chars
Change-Id: I1760c8ab3f313241965c93571f9637c5b0aeebc4
2013-07-31 14:45:09 -07:00
bsitu 2c7ec70dc6 The email should be sent in the recipient's language
At the moment it is sent in the sender's language.

Bug: 52298
Change-Id: I7f689963105585cf74a902cf975fffb592135ed4
2013-07-31 02:47:15 +00:00
bsitu ced3989f2a Update email text color and add a period to email notification text
Change-Id: I9d9da6aee9ce36f6350f934b11a49cdf2492ea9c
2013-07-30 10:36:27 +02: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
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
jenkins-bot e1be0ace4a Merge "(bug 47666) All system messages should have sender = -1" 2013-06-13 21:09:48 +00:00
jenkins-bot a334ca1350 Merge "LIMIT is not a supported DatabaseBase::update option" 2013-06-13 17:24:21 +00:00
bsitu 09c531a11f (bug 47666) All system messages should have sender = -1
Change-Id: I0f7458b0e76c600c6bb383bd320b483adfd76d98
2013-06-12 19:26:57 -07:00