Moved the factory deeper into the code right before the one usage it
still needed a full user object
Narrow done method arguments from User to UserIdentity
and use the identity directly
Change-Id: Ic118f23ef504c7fda892480df61ea68c10915f78
The form UI currently allows selecting Special/Media pages, even though these notifications are not applicable on those pages.
Also:
- Update some comments regarding LoadUserOptions hook
- Remove $titleFactory as MultiTitleFilter doesn't require it any longer
Change-Id: I74f7b0091cb5f47c34a54958656e2bce20a394ec
$user->saveSettings() happens in AuthManager after the LocalUserCreated
hook finishes running.
Bug: T199393
Change-Id: I1e1826c9f304d7b6c8f3663196a48267a0af0bae
The global function wfWikiID() is deprecated since 1.35 and it's usages
should be replaced with WikiMap::getCurrentWikiId().
Bug: T298059
Change-Id: Ia8cbc992eb80ee6d531cf11bdf2bc06181bce8b0
Replace User::getOption() with UserOptionsLookup::getOption() since this method will be hard-deprecated.
Bug: T296083
Change-Id: I0ecdc63b0344bc4c24196cc5edb3d02b6a7ed615
* Use LinksUpdateComplete instead of the unusual hook
LinksUpdateAfterInsert, which I want to deprecate.
* Fix the fixme regarding revert detection in link events. It's not
pretty but I confirmed that it works with undo and rollback.
Bug: T297011
Change-Id: Ic0092a55e85a3db78db98f1a3dfdce74a7fa2b29
If the page is deleted, we won't be able to find it (easily) in
WatchlistChangePresentationModel. Luckily there's support for using
backup data for constructing the title; we just need to pass along the
DBKey and namespace data in the extra params for the event.
Bug: T286192
Change-Id: I8e46de9599a213d9c22ce7bbedefa00528887f59
The MWNamespace class has been deprecated in favor of the NamespaceInfo
service. All methods in the MWNamespace should be replaced with the
equivalent methods of the NamespaceInfo service.
Bug: T291389
Change-Id: I396c50c7537b21b2f88dd9433180a8317c5c27f3
explode always returns an array with one item, even for the empty string
Filter out every possible empty string
Change-Id: I0cf0794c0f3e0eedab7e5626e973d8458b28e46a
talk-alert copies the mytalk link but does not disable the icon.
In future this will cause an unexpected icon to appear on the
message bar which is not wanted.
Change-Id: Icd585ad846275a140eb08edf99e1b27257484941
Using 'text' in skins must provide a string,
not a message (see Skin->makeLink)
Avoid also global state by using the SkinTemplate as ContextSource for
the message
Change-Id: Ie736487023d7aeb31cdb1829ba59adeb0ba2b022
This hook is no longer called in MW 1.36+ by core, and this
extension already requires MW 1.37+
See I5124789fac333a664b73b4b4a1e801ecc0a618ca
Change-Id: I420c2a231cc1c7d6a350a1f04f7c7d4fd942b377
Some of Echo's subscription user preferences are mapped to existing
user preferences defined in core MediaWiki. However, this special page
was checking the Echo preference names, returning incorrect values.
This affected the edit-user-talk preference and watchlist preferences
(not available with the default configuration).
Change-Id: I2de7553f82434505c000c30a71b9f90c4490482b
User::setOption() is deprecated and should be replaced with UserOptionsManager::setOption()
Bug: T277818
Change-Id: I001301fb95635c421a0bbb921fd909c5312dc896
Update to 7880cc18, restores ".mw-echo-alert" class on "class" property
instead of on "link-class" property.
Bug: T284496
Change-Id: I11a04fa5a7e9d0b34e62733ee537a43549d13477
If there's exactly one new user talk message, then link directly to it
from the orange banner.
I'm using EchoEventPresentationModel to get the link target, instead
of some more direct way, because this approach allows us to override
the link in DiscussionTools. Together with the changes proposed in
T281590, this would allow linking directly to individual messages (and
highlighting them), rather than just the section.
Bug: T58475
Change-Id: I1fd0e22f4ee0f0dfacaf420d3fd890dce0820cbd
Note: This change would potentially affect all skins including modern
and legacy Vector and others.
The status quo when a talk notification is present is to transform the
talk link into an orange notification message. One option is to leave
the talk link and **add** a notification instead of transforming it.
This will result in two elements #pt-mytalk and #pt-talk-alert
This will interfere with styles targeting #pt-mytalk .mw-echo-alert
This impacts user styles but not anything in production.
Bug: T283811
Change-Id: I3e4be1381f9a2e9986b94b3b13df5ed64d09a59d
Before this commit, setting:
```
$wgVectorConsolidateUserLinks = [
'logged_in' => true
];
```
would result in an orange talk notification that had missing or
incorrect attributes (`#ca-mytalk` instead of `#pt-mytalk` and missing
the `title` and `accesskey` attributes) when visiting modern Vector
with a talk notification visible. The notification's html looked like:
```
<li id="ca-mytalk" class="mw-echo-alert">
<a href="/wiki/User_talk:Newuser5">You have a new Talk page message</a>
</li>
```
The `pt-mytalk` id is important for echo to remove the notification [1].
The title and accesskey are important for accessibility reasons.
This commit corrects that by setting a `link-class`, setting an explicit
`id`, and NOT setting a `class` key. This results in html that is
correct in both modern and legacy Vector:
```
<li id="pt-mytalk">
<a href="/wiki/User_talk:Newuser5" class="mw-echo-alert" title="Your talk page [ctrl-option-n]" accesskey="n">You have a new Talk page message</a>
</li>
```
[1] 67bf58a489/modules/ext.echo.init.js (L172)
Bug: T274428
Change-Id: I5afc74992ad3153ac32df65ccf5fd03b469f05fb
**Note**: This change will affect the order of the yellow talk page
message notification on legacy Vector/other skins by moving it from
after the `#pt-notifications-notice` element to before the
`#pt-notifications-alert` element. This was done because the
notification is related to the list of messages that appear when the
bell icon is clicked so having it in close proximity to that icon is
hopefully more intuitive than having it next to the unrelated inbox
icon. [1]
Per T274428, we need this notification to be inside the `notifications`
array instead of inside the `user-menu` array.
Additionally:
* Per T274428, update the notifications message copy to "You have a new
Talk page message"
* Remove the `onPersonalUrls` hook method inside EchoHooks,
unregister its use as a hook in extension.json, and update its
references in Echo.
[1] T274428#7113896
Bug: T274428
Change-Id: I5ae0ec089bcf0eec1ec7ac13f60e811f54e1d8e1
Thanks to the changes from T254074, the EditResult object passed to
the 'PageSaveComplete' hook now knows whether the edit being saved
is a rollback. We don't need to pass this information from the
'RollbackComplete' hook via globals.
Bug: T277649
Change-Id: Ieef7941e4665204b1a9b2356a58216626ed1f54b