Commit graph

435 commits

Author SHA1 Message Date
Roan Kattouw ff4a54d7f1 MentionPresentationModel: Remove pageLink from secondary links
It wasn't meant to be there, and flow-mention doesn't have it either.
We also don't have any other notification types with
three prioritized secondary links.

Bug: T125949
Change-Id: Icbffa185b1116b1a6beb9bb3585339fdf7e82cdd
2016-02-26 20:41:13 -05:00
Roan Kattouw ba27d4b8f6 ForeignNotifications::populate(): Fix max timestamp computation
We weren't using the maximum timestamp, just the most recently
encountered one.

Change-Id: Ie1cfd8130ab0c5077c4b720101d214d33e3ea9b4
2016-02-26 13:32:48 -08:00
Stephane Bisson 67facac67d Force notification body on a single line
The approach here is to use $msg->escaped() to
remove all markup and then replace new lines
with a single space.

Bug: T128062
Change-Id: I1d5a6e57fbae9b6a441671beff1c60720b9445d5
2016-02-26 07:00:38 -05:00
jenkins-bot cc87b9a35f Merge "Bidi-embed formatter user names (the $1 parameter) in notification messages" 2016-02-25 18:46:02 +00:00
jenkins-bot 04522752ed Merge "Notification: use speechBubbles icon for all talk pages" 2016-02-24 21:43:26 +00:00
Roan Kattouw e7cd68baf1 Bidi-embed formatter user names (the $1 parameter) in notification messages
Bug: T127407
Change-Id: I51fdbdfd0a706f21f36513b1e8beeeddffe8bec7
2016-02-24 13:34:53 -08:00
jenkins-bot 656d6c401c Merge "Handle null user when trying to generate a link for notifications" 2016-02-24 21:29:25 +00:00
Stephane Bisson 3e028b8b1d Add 'Log' link to user-rights notification
Bug: T127249
Change-Id: I0ee20fefa2241d2858e6473bb709dce9519b82d4
2016-02-24 13:23:34 -05:00
Stephane Bisson f1e68f9451 Handle null user when trying to generate a link for notifications
Bug: T127728
Change-Id: I87de2d10887216e3edf53c2972b6bf230191f0ea
2016-02-24 11:42:03 -05:00
jenkins-bot 701f684eee Merge "Delete rows in echo_unread_wikis if there are no unread notifs" 2016-02-23 21:18:12 +00:00
jenkins-bot ac952bf5e8 Merge "Add GENDER support to 'View changes'" 2016-02-23 20:45:35 +00:00
jenkins-bot 92d0d4c533 Merge "Echo API returns absolute URLs in notification links" 2016-02-23 18:02:40 +00:00
Stephane Bisson a73d63d1a4 Echo API returns absolute URLs in notification links
Some notifications return relative urls in their
primary or secondary links. This change makes those
urls absolute so they point to the right wiki
when viewed from another wiki (cross-wiki notifications).

Bug: T125738
Bug: T127697
Change-Id: Ib65337430eb2484f9491668a9998deef70589fb1
2016-02-23 17:54:26 +00:00
Matthias Mullie 4715b55471 Add GENDER support to 'View changes'
Change-Id: I42b8b253b8b865c081ba1aec62848afadd21e0f4
2016-02-23 17:56:16 +01:00
Matthias Mullie 6be71f2fae Delete rows in echo_unread_wikis if there are no unread notifs
It used to be like this, but in order to get the messages badge to show
in the correct circumstances, I had to know if the user had ever had
foreign messages before & I also needed euw_messages_ts even if those
messages had already been read.

Now that we're unconditionally showing messages, we no longer need these
0-value rows.

Bug: T127731
Change-Id: I1fc13bf0e5133ae39224f66d1b5a59c769bfcee2
2016-02-23 16:21:28 +01:00
Stephane Bisson 860404eded Notification: use speechBubbles icon for all talk pages
Bug: T56433
Change-Id: I14e1af9dda1c08e1526fde59072f93189ab0b0d0
2016-02-23 06:53:55 -05:00
Kunal Mehta 7fbec72803 Always show the messages flyout icon
Bug: T127731
Bug: T124372
Change-Id: Ie97229b7ef34cd807f16c76ceae0682c425c53b4
2016-02-23 01:21:28 -08:00
Matthias Mullie 3979919087 Display human-readable wiki names for cross-wiki notifications
Bug: T121936
Change-Id: Ic14fe65f4ecc6db94fc6774ca0c39d1c2a47db9d
2016-02-22 20:09:53 +01:00
jenkins-bot 75282786fd Merge "Fix hasMessages result when inconsistently enabling cross-wiki" 2016-02-19 20:09:25 +00:00
Matthias Mullie 9f203c560f Fix hasMessages result when inconsistently enabling cross-wiki
Current situation: cross-wiki can be enabled on certain wikis &
disabled on others.
Code used to check if cross-wiki was enabled before fetching the
status of unread messages on foreign wikis. However, it would then
write that result to a shared memcached key.

The cross-wiki check should not happen before data is stored to
cache: what is stored should always be for all wikis. Only when
we fetch it, should we check if cross-wiki is enabled. And if it's
not, we can't use the cross-wiki data - we have to hack around it
ourselves...

Bug: T124372
Change-Id: I3d3d54fc3cbfbf73b51e97acfd8d355dd0cea36d
2016-02-19 11:37:16 -08:00
Matthew Flaschen 4b316438a5 Fix 'Undefined index' PHP warning so XDebug doesn't complain
Change-Id: Id8f8113bcdc454d5df09a20175c7698791b71fba
2016-02-19 05:09:45 +00:00
Stephane Bisson 7dc87b9f7a Allow setting the unread counts to 0 in the echo_unread_wikis
Bug: T127331
Change-Id: I90342c9d64277faa77a905b227148d3102d049cb
2016-02-18 15:31:55 -05:00
Stephane Bisson 74879c39fb Truncate secondary link labels
Bug: T121822
Change-Id: I3e36a6cd4bc8da96879158e1d7b65fd3a1d582fb
2016-02-18 06:55:36 -05:00
jenkins-bot d1830041af Merge "Include reason in user-rights notification body" 2016-02-16 17:59:12 +00:00
Stephane Bisson dff7e8072b Include reason in user-rights notification body
Bug: T126277
Depends-On: Ib9bb28a7a77602e3e729fd0bf13ab8259e15b006
Change-Id: I4941c4ba16ee95798767d858792090609b47b4e4
2016-02-16 01:51:07 +00:00
Stephane Bisson 98861d059a Truncate section names to 50 char
Bug: T121822
Change-Id: I6220fdfb2ad20cfe9935895a2f5a16727d6cbc01
2016-02-15 15:59:00 -05:00
jenkins-bot 2bf38f6c37 Merge "Get rid of pre-5.4 CallbackFilterIterator implementation" 2016-02-13 07:25:50 +00:00
jenkins-bot 33ee3ebf80 Merge "Have EventPresentationModel implement JsonSerializable" 2016-02-13 07:23:50 +00:00
Kunal Mehta 92f69106cd Get rid of pre-5.4 CallbackFilterIterator implementation
Change-Id: Ie2e26eeb9d819db0353e446a7dcd87a809992d92
2016-02-12 14:20:16 -08:00
jenkins-bot 5019802f29 Merge "Introduce congratulatory notifications for reaching edit thresholds" 2016-02-12 22:19:04 +00:00
Kunal Mehta 7f981670a3 Have EventPresentationModel implement JsonSerializable
Change-Id: I25a9ba9371ccf6c246de21fbb2c880441e051090
2016-02-12 14:15:23 -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
Stephane Bisson 09928f1ed2 Add email body preview to emailuser notification
when the subject line is left with the default
generated value, we take the begining of the
email content to add a preview in the
notification.

Bug: T121831
Change-Id: Ib7c646f6709c7100ef51186f84fe14807d6a211a
2016-02-12 14:50:17 -05:00
jenkins-bot 202afb8227 Merge "Truncate usernames to 20 char in notifications" 2016-02-11 19:02:21 +00:00
Matthias Mullie 799d4de339 Comparing User objects is unreliable
Objects can be different instances (and for User, they can contain
very different data) in which case they wouldn't be recognized even
if they were the same user.
Let's find by ID instead.

Bug: T124803
Change-Id: Ia166fd4190f264354cea83d98047c62c7e0714ea
2016-02-11 14:48:29 +01:00
jenkins-bot f0ca5a5f0d Merge "If user only has foreign messages, the messages badge should not be suppressed" 2016-02-10 21:02:15 +00:00
Stephane Bisson 442f812774 Add subject to email notification body
Bug: T121831
Change-Id: Ib1a9212202d2c84de8d968d043f65e24b2d94fae
2016-02-10 12:34:26 -05:00
Matthias Mullie b9f2d026a6 If user only has foreign messages, the messages badge should not be suppressed
Bug: T124372
Change-Id: Id9699c56e9b8c6af77e74cbfc48b6e4e3464b3a5
2016-02-10 13:25:50 +01:00
Stephane Bisson 961968ff56 Truncate usernames to 20 char in notifications
Bug: T121822
Change-Id: Ie9650b5c72f2224dc6d26b3bfc45f29cbbd23397
2016-02-09 13:46:39 -05:00
jenkins-bot ccebb42186 Merge "Get rid of old flyout formatter code" 2016-02-09 18:34:36 +00:00
jenkins-bot f9b8202f4f Merge "Use current HTML formatter (for special page) instead of previous" 2016-02-09 18:22:33 +00:00
Stephane Bisson f7b0637d59 Fix 'user-rights' notification messages
Bug: T121661
Change-Id: I5b73001f2f748a39c3b28f6b571f076a51f8f785
2016-02-08 08:45:10 -05:00
Matthias Mullie 9fe71a1182 Get rid of old flyout formatter code
This code is completely useless:
* for format=flyout, the new EchoFlyoutFormatter.php will be run
* and even that one has already been deprecated as it was replaced
  by format=model (flyout html is now built in client)

Change-Id: Iea23abb66397ecc4efb575fe33fdbedc5b4e0f70
2016-02-05 06:56:15 +00:00
Matthias Mullie 1be7039660 Use current HTML formatter (for special page) instead of previous
The existing "html" formatter was used for the special page & is now
superseeded by the new-style "special" formatter. Previous "html"
notifications are no longer used & could even be broken.
Instead of keeping the old "html" formatter around, we should let it
use the new formatter (and eventually just kill that redundant format
in the API)

Change-Id: Ibbd40aafa9eee718b196ad62f6edc99629b263b4
2016-02-04 20:03:19 +00:00
Matthias Mullie 4f097b02d0 Get rid of $legacyMapping
We now have 'special' in $formatters, there's no need to keep
the mapping to the legacy formatter around.

Change-Id: I66f330e8c84a50858658361caef521a3e5717d58
2016-02-04 19:57:06 +00:00
jenkins-bot d5ec5d0d92 Merge "Deprecate ApiEchoNotifications.php format params flyout & html" 2016-02-04 19:55:34 +00:00
Matthias Mullie c94c8abb53 Deprecate ApiEchoNotifications.php format params flyout & html
Change-Id: Ib1db9dbec7a0980b10ba4dc1b3f62ea468437390
2016-02-04 12:38:19 +00:00
Matthias Mullie cc11b3c81a Allow certain users to be excluded
Right now, if certain users should be excluded, that would have
to be part of the user-locators already. This is annoying because
it's hard to write "generic" user locators when you want to exclude
just a couple of people in certain cases.
In Flow, for example, we have user-locators for users watching a
board or topic. We don't want to send the notification to people
that have also been mentioned in that post (they'll get a separate
notification). We could build that exception into those
user-locators, but then we couldn't re-use them in other places...
This basically means we couldn't use EchoUserLocator::locateUsersWatchingTitle,
we would have to roll our own that also excludes mentioned users.

Instead, this lets you add 'user-filters' (that functionality
actually exists already, but is not currently exposed), which
lists users to not send the notification to, even though they could
be in a user-locator.

Bug: T125428
Change-Id: Ifa0e2d3283f57624af4c5ec264f9f66223508e83
2016-02-04 11:20:59 +01:00
Stephane Bisson ffc4365b08 Make sure to use array_values for group names in user-rights notifications
Bug: T125279
Change-Id: I49b5fe5cf27aef5b710a5d95a064b09b08612667
2016-02-01 13:30:25 -05:00
jenkins-bot 59fc1b6f85 Merge "Add snippet to mention notification" 2016-02-01 09:10:05 +00:00