Commit graph

748 commits

Author SHA1 Message Date
Kavitha Muthu a518044bb3 Make user rights notifications link to added/removed group
This change was made to direct users to the added/removed group.
Notification about the change in the user's right will route the user
to a page about the group.

Bug: T55860
Change-Id: Iff5f4d38ca2cc479c269ef736a7fd957959a03dc
2016-09-27 03:53:53 +00:00
jenkins-bot f40f1aa36c Merge "Convert 'seenTime' to a global property" 2016-09-20 23:22:26 +00:00
Matthew Flaschen ffd9d4bb4d Fix moderation controller
The change to use DeferredUpdates had a missing use.

Change-Id: Ied72608c9b3aa597627aa5ea069c257f506c3c1b
2016-09-20 01:44:25 -04:00
jenkins-bot 21cd011dda Merge "Make sure bundledNotifications is an array" 2016-09-20 00:13:56 +00:00
Moriel Schottlender f47c554e1c Make sure bundledNotifications is an array
- Make sure that even if internal values of the array are null,
  the end-result is a valid array (with sequential keys)
- Verify that the API sent the UI an actual array, and if not,
  output an error to the console.

Bug: T145825
Change-Id: Ibdf17c58fe88e3e2547dde62cd4d3d06e089cbc8
2016-09-19 23:08:14 +00:00
jenkins-bot 92c7c8d521 Merge "Remove primary link from the bundle of page linked notification" 2016-09-19 22:59:15 +00:00
Moriel Schottlender 1575e2bb7a Convert 'seenTime' to a global property
This transforms seenTime concept to a global property for all wikis
and sources, and updates the global seen time on opening the popup.

Bug: T134855
Change-Id: I67bcc4b346237317c7a9204dd43cd0e9ee02792f
2016-09-19 14:37:31 -07:00
Moriel Schottlender 58c53af1d1 Remove primary link from the bundle of page linked notification
Also, make sure that the bundle follows the same behavior as the
xwiki bundle, where if it does not have a primary link, the 'click'
event triggers the 'expand' action.

Bug: T145902
Change-Id: I456bf76a7bd531ffcad5462708f37cd54d8af99d
2016-09-19 14:16:43 -07:00
jenkins-bot bac8d67e99 Merge "Count the number of success & failure notifs sent" 2016-09-19 08:14:32 +00:00
Matthew Flaschen f2327a919b Fix GENDER without explicit parameter
Although we generally use getViewingUserForGender, these messages
are UI and in user language, so we should change the flag anyway.

getViewingUserForGender is essential for messages that are used
in batch jobs.  Some messages technically don't require it, though
it's probably best to be consistent anyway.

Bug: T144538
Change-Id: I7b57777ab93b5752165c7bdd85fa5ce66b294b22
2016-09-14 16:39:49 -04:00
addshore cb575928a9 Count the number of success & failure notifs sent
Change-Id: I3e11bc8878ddf48265c628d828ee700f3aee7bbb
2016-09-14 13:35:03 +02:00
Jakob Warkotsch 3da89ea4d9 Send notification for mentions on changes
This sends out a notification when a user gets mentioned in a change as
long as a signature is added in the same section.

Bug: T138938
Change-Id: Ie183fbb8150bd9451a5b0a9fea0227e3241b26a0
2016-09-14 12:36:22 +02:00
jenkins-bot 5fd9831c07 Merge "Send mentions when editing multiple sections in between sections." 2016-09-14 10:06:36 +00:00
Catrope bba984c002 Revert "Make seen/unseen badge more consistent across wikis"
Has bugs, and will likely cause deployment problems.
This'll need to be reverted in wmf.19 at least
until we fix it up.

This reverts commit 00e0b9f45d.

Change-Id: Ia9d220ebcb607f96dee6bc856755305ed8501fcc
2016-09-13 14:21:32 -07:00
jenkins-bot 1f3517e562 Merge "Fix seen time for new users" 2016-09-13 17:31:59 +00:00
Moriel Schottlender cc36178e4a Add {{GENDER}} support to dynamic action messages
Make sure we pass the current user to the message, since empty
{{GENDER:|}} doesn't seem to work in PHP.

- Add parameter to documentation
- Add {{GENDER}} syntax to en.json as example
- Add parameter to the message creation

Bug: T144538
Change-Id: Ifc5e3bbe8309cc9ce120b7d61cdc050d7055aacc
2016-09-12 15:30:29 -07:00
jenkins-bot 28248c0cc2 Merge "Actually insert target page entries when creating an Event" 2016-09-12 21:32:03 +00:00
Stephane Bisson d7845da3f6 resetNotificationCount() from replica with no lag
When notifications are being moderated, the unread count
for affected users has to be recalculated.

It was initially done using DB_SLAVE but it was leading
to inconsistent data since that database did not know
about recently deleted notifications.

It was changed to DB_MASTER but it potentially led
to too many queries on master.

This patch tries to wait for the replica to have
caught up with those changes and use it to update
the unread count for the affected users.

Bug: T93673
Change-Id: Ib4a845e82f686dd7ed807ab21a28490014b56604
2016-09-12 19:59:02 +00:00
Stephane Bisson bc03468473 Actually insert target page entries when creating an Event
This was broken in Ib57510e6b0e9202a7e035f8ea59955dca8a0b24a

Bug: T145232
Change-Id: Ieaad1febaf07bdcf8aee3761afbd039c082fc9ad
2016-09-12 15:05:18 -04:00
jenkins-bot 7f24836607 Merge "Make PresentationModel::getPrimaryLinkWithMarkAsRead() final" 2016-09-12 13:28:05 +00:00
Kunal Mehta 7051cfb2a5 Make PresentationModel::getPrimaryLinkWithMarkAsRead() final
Subclasses should not override this. Also fix the return type phpdoc of
getNotificationCountForOutput().

Change-Id: Ia6963794d3a68dca742fe52ac197edf1575bed76
2016-09-11 12:46:08 -07:00
Moriel Schottlender 615ffb1125 Always cap notification count based on MWEchoNotifUser::MAX_BADGE_COUNT
Also increase Echo version so we update the cache.

Bug: T144707
Change-Id: Ie939d313c8c6a8168fa3eb3036d9275270575559
2016-09-09 17:15:15 -07:00
Matthew Flaschen 98c6cd9eab Fix seen time for new users
Until the user opens the popup the first time, everything should be
unseen, rather than nothing unseen.

Also, make the default 'everything unseen' if we forget their seen
time.

Change-Id: I99ff8d46d4fa2fab0db374ddff63727b18a68363
2016-09-09 17:46:34 -04:00
Sébastien Santoro ad0cf6cda0 Fix MentionStatusPresentationModel::getSecondaryLinks return value
Any class implementing EchoEventPresentationModel and overriding the
getSecondaryLinks method should return an array (while getPrimaryLink
could return a false boolean value).

This change fixes the following errors:

Warning: array_values() expects parameter 1 to be an array or collection
in …/extensions/Echo/includes/formatters/EventPresentationModel.php on line 494

Warning: array_filter() expects parameter 1 to be an array or collection
in …/extensions/Echo/includes/formatters/EventPresentationModel.php on line 494

This is a follow-up for commit b4b59ee4.

Bug: T145229
Change-Id: Ic66ca03b6979472495c9b748093d01f8f097d56a
2016-09-09 19:59:09 +00:00
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
Moriel Schottlender 59c0ad6c4d Make 'Edit threshhold' notif appear regardless of title existence
If a user recieves 'this is your X edit' they should get this notif
regardless of whether the edit they created was deleted. We should
make sure the title is there only for deciding whether or not to
create a link for it; otherwise, the notification will just appear
without a link to the revision.

Change-Id: I00ed4278bb4e15b1e9ddfa2c3af8fad0540fc5f8
2016-09-08 23:01:47 +00:00
Roan Kattouw 48ca4aeb5e ModerationController: Update count from master, not slave
At the time that resetNotificationCount() is called, we've only
just moderated something, so the slave won't have those changes yet,
and the computed notification count will be wrong.

Change-Id: Ia83f2b9cf7f4bbaee25e03f7bc8f73bcd4d345f9
2016-09-08 15:26:07 -07:00
Moriel Schottlender 00e0b9f45d Make seen/unseen badge more consistent across wikis
- Add a 'hasUnseen' data to the xwiki bundle so the badge can
  consider its value when changing its color even without the
  bundle being opened.
- Check and store seenTimes from all sources that the xwiki
  has in a new JS object that the SeenTimeModel can store

Bug: T134855
Change-Id: Ifdcee88b4378cdc7acb4ae5c0cbc60b76339757e
2016-09-08 12:40:15 -07:00
Chad Horohoe da4f8f5db9 Use static cache for times so it works across instances of SeenTime
Follows-up If6319a02. Making the cache static enables us to reuse
the in-process cache across multiple instances of the class.

Bug: T144534
Change-Id: I1a594830f13d56ab4e0e636a3cdb5e96379e990a
2016-09-08 12:24:46 -07:00
WMDE-Fisch 4ac1711be8 Send mentions when editing multiple sections in between sections.
This patch fixes mentions not being send when multiple sections were added
in between sections.

Since we only want to send mentions when userlinks and signature are present
in the same section a new method was added extracting sections and the related
content from an addition. The results are checked whether a section content
contains a signature and might be relevant for mentions.

Bug: T141863
Change-Id: I434c664552bbadbeef6e897e20703e813f5a4c52
2016-09-08 15:15:14 +02:00
Moriel Schottlender eb98b21dfe Add 'canRender' check to EchoMentionStatusPresentationModel
Change-Id: Ica338ff5810b62849d30e5b27709558f1b797c43
2016-09-06 14:44:51 -07:00
Kunal Mehta b3cdd56952 SeenTime: Wrap cache with CachedBagOStuff
That adds an in-process cache so we don't have duplicate key lookups on
every request.

Bug: T144534
Change-Id: If6319a026c457a32bfde0e212c6193aa728cb208
2016-09-06 13:06:26 -07:00
jenkins-bot cf7cf0dd66 Merge "Provide title when parsing wikitext" 2016-09-02 01:48:33 +00:00
Stephane Bisson c75d974004 Provide title when parsing wikitext
Bug: T141460
Change-Id: I802c9c4bf964a060e44f25a487b5aec6f7d8c6b6
2016-09-01 16:48:56 -04:00
Moriel Schottlender 97a7d44190 Clean up Special:Notifications output
Transform the php output to OOUI widgets.

Bug: T129172
Change-Id: I65cb5f2a016fc2a3c33a0b1cd2f3f88ed963ab02
2016-09-01 13:38:06 -07:00
Moriel Schottlender a0e02da71f Style changes for unwatch actions
- Reverse 'watch' / 'unwatch' star icons
- Truncate title texts
- Minor indentation fix

Bug: T132975
Change-Id: I1dbd6d1480f6ef5a45184271c932cd27258f7424
2016-08-26 14:58:10 -07:00
jenkins-bot 23e95ec3fe Merge "Dynamic actions: Reuse label/description for those fields" 2016-08-26 18:12:54 +00:00
Stephane Bisson 405b8ce084 Loading notifications starting with one big local bundle
Redo of cc86387f80 but
trying not to break the special page this time.

Bug: T143813
Change-Id: Id39d18a2ba4efa2b49ed42d10aa9aeef0e4672f0
2016-08-26 06:45:48 -04:00
Matthew Flaschen 299b66f937 Dynamic actions: Reuse label/description for those fields
This is necessary to preserve backwards compatibility for the API, and
this also fixes the no-JS special page.

Also, fix additional warnings.

Change-Id: Id603b4ab22c69097d5559a756bec72a6ba785661
2016-08-25 22:00:25 -04:00
jenkins-bot c82e390591 Merge "Remove unused method EchoEventMapper::fetchByUserBundleHash" 2016-08-26 00:17:59 +00:00
jenkins-bot 6249814324 Merge "Revert "Get the overfetched before bundling to avoid removing the base"" 2016-08-25 22:46:31 +00:00
Catrope 7c400c927e Revert "Get the overfetched before bundling to avoid removing the base"
Breaks pagination. At least on Elena's machine, this results
in only 51 results being shown with no pagination controls.

This reverts commit cc86387f80.

Change-Id: I6f888581039dc9171ce2114c47e53c2eda4eb8a3
2016-08-25 22:39:43 +00:00
jenkins-bot 276a38e8ad Merge "Get the overfetched before bundling to avoid removing the base" 2016-08-24 18:55:44 +00:00
Stephane Bisson cc86387f80 Get the overfetched before bundling to avoid removing the base
Bug: T143813
Change-Id: I82809d5fe1dd919810349d820a5f62175ce48fd4
2016-08-24 14:38:21 -04:00
Stephane Bisson 9dd4e4ee30 Don't select echo_event.*
Removed fetchByTypesAndPage since it is now unused

Fixed fetchByPage to select simple * instead of
echo_event.*

Bug: T105890
Change-Id: I486f27501a649d5368305965d2cd012afe0915b2
2016-08-24 12:56:49 -04:00
Roan Kattouw ce3d6b2f49 Remove unused method EchoEventMapper::fetchByUserBundleHash
Bug: T143763
Change-Id: Iad63e8866eeccf316b3efe3a44888256c0c407d8
2016-08-23 19:22:01 -07:00
jenkins-bot 4e99a5095f Merge "Add dynamic secondary actions to notification items" 2016-08-23 17:43:08 +00:00
Roan Kattouw ff2c58cdc4 Follow-up 8eda2aa3f: actually render the nojs message on Special:Notifications
Change-Id: Id0d931f8465c2abfa41b1053ec2b2d0a632037ed
2016-08-22 16:16:41 -07:00
Moriel Schottlender 480ce92bd8 Add dynamic secondary actions to notification items
Allow extensions to add dynamic actions that perform some
API request and display a confirmation message.

Bug: T132975
Change-Id: Ib16d57c3f1a11a9749564c6e2112bf1ca32c55e8
2016-08-22 16:04:48 -07:00
Matthew Flaschen f36d20ba4d Fix special page visit logging
'version' was missing, making the event invalid, causing it to
not reach the database.

Factor out this field to logEvent

Bug: T121939
Change-Id: I9e4bb5574d69495cb5f53830047c68104c6ad10f
2016-08-22 16:35:50 -04:00