jenkins-bot has submitted this change and it was merged.
Change subject: K4: add links so new topic notifications are linked from
Special:Notifications
......................................................................
K4: add links so new topic notifications are linked from Special:Notifications
Change-Id: I2b7b845c0200356fc4297be2be1be2236b275b1e
---
M i18n/en.json
M i18n/qqq.json
M includes/Notifications/Formatter.php
M includes/Notifications/Notifications.php
4 files changed, 16 insertions(+), 7 deletions(-)
Approvals:
Matthias Mullie: Looks good to me, approved
jenkins-bot: Verified
diff --git a/i18n/en.json b/i18n/en.json
index 5902b9b..a297b97 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -241,8 +241,8 @@
"flow-notification-reply-bundle": "<span class=\"plainlinks
mw-echo-title-heading\">[$4 $2]</span><br />$1 and $5
{{PLURAL:$6|other|others}} {{GENDER:$1|responded}} on '''$3'''.",
"flow-notification-edit": "$1 {{GENDER:$1|edited}} a <span
class=\"plainlinks\">[$5 post]</span> in \"$2\" on [[$3|$4]].",
"flow-notification-edit-bundle": "$1 and $5 {{PLURAL:$6|other|others}}
{{GENDER:$1|edited}} a <span class=\"plainlinks\">[$4 post]</span> in \"$2\" on
\"$3\".",
- "flow-notification-newtopic": "<span
class=\"mw-echo-title-heading\">$4</span><br />$1 {{GENDER:$1|created}} a new
topic on '''$3'''.",
- "flow-notification-newtopic-bundle": "{{PLURAL:$1|$1|250=250+}} new
{{PLURAL:$1|topic|topics}} on '''$2'''",
+ "flow-notification-newtopic": "<span class=\"mw-echo-title-heading
plainlinks\">[$5 $4]</span><br />$1 {{GENDER:$1|created}} a new topic on
'''$3'''.",
+ "flow-notification-newtopic-bundle": "{{PLURAL:$1|$1|250=250+}} new
{{PLURAL:$1|topic|topics}} on '''<span class=\"plainlinks\">[$3 $2]</span>'''",
"flow-notification-rename": "$1 {{GENDER:$1|changed}} the title of
<span class=\"plainlinks\">[$2 $3]</span> to \"$4\" on [[$5|$6]].",
"flow-notification-mention": "$1 {{GENDER:$1|mentioned}}
{{GENDER:$5|you}} in {{GENDER:$1|his|her|their}} <span class=\"plainlinks\">[$2
post]</span> in \"$3\" on \"$4\".",
"flow-notification-link-text-view-post": "View post",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index acf091f..05cf2f2 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -245,8 +245,8 @@
"flow-notification-reply-bundle": "Notification text for when a user
receives replies from multiple users on the same topic.\n\nParameters:\n* $1 -
username of the person who replied\n* $2 - title of the topic\n* $3 - title for
the page that the Flow board is attached to\n* $4 - permantent URL for the
post\n* $5 - the count of other action performers, could be number or
{{msg-mw|Echo-notification-count}}. e.g. 7 others or 99+ others\n* $6 - a
number used for plural support\nSee also:\n*
{{msg-mw|Flow-notification-reply-email-batch-bundle-body}}\n{{Related|Flow-notification}}",
"flow-notification-edit": "Notification text for when a user's post is
edited. Parameters:\n* $1 - username of the person who edited the post\n* $2 -
title of the topic\n* $3 - title for the Flow board\n* $4 - title for the page
that the Flow board is attached to\n* $5 - permanent URL for the
post\n{{Related|Flow-notification}}",
"flow-notification-edit-bundle": "Notification text for when a user
receives post edits from multiple users on the same topic.\n\nParameters:\n* $1
- username of the person who edited post\n* $2 - title of the topic\n* $3 -
title for the page that the Flow board is attached to\n* $4 - permantent URL
for the topic\n* $5 - the count of other action performers, could be number or
{{msg-mw|Echo-notification-count}}. e.g. 7 others or 99+ others\n* $6 - a
number used for plural support\nSee also:\n*
{{msg-mw|Flow-notification-edit-email-batch-bundle-body}}\n{{Related|Flow-notification}}",
- "flow-notification-newtopic": "Notification text for when a new topic
is created. Parameters:\n* $1 - username of the person who created the topic\n*
$2 - (Unused) title for the Flow board\n* $3 - title for the page that the Flow
board is attached to\n* $4 - title of the topic\n{{Related|Flow-notification}}",
- "flow-notification-newtopic-bundle": "Notification text for when
multiple new topics are created on the same page. Parameters:\n* $1 - The
number of topics that were created. This value is capped to 250. When this
value is 250 it means 250 or more topics have been created.\n* $2 - The title
of the page the topics were created on\n{{Related|Flow-notification}}",
+ "flow-notification-newtopic": "Notification text for when a new topic
is created. Parameters:\n* $1 - username of the person who created the topic\n*
$2 - (Unused) title for the Flow board\n* $3 - title for the page that the Flow
board is attached to\n* $4 - title of the topic\n* $5 - Fully qualified url to
view the created topic.{{Related|Flow-notification}}",
+ "flow-notification-newtopic-bundle": "Notification text for when
multiple new topics are created on the same page. Parameters:\n* $1 - The
number of topics that were created. This value is capped to 250. When this
value is 250 it means 250 or more topics have been created.\n* $2 - The title
of the page the topics were created on\n* $3 - Fully qualified url to view the
related board sorted by newest topics.{{Related|Flow-notification}}",
"flow-notification-rename": "Notification text for when the subject of
a topic is changed. Parameters:\n* $1 - username of the person who edited the
title, can be used for GENDER\n* $2 - permalink to the topic\n* $3 - old topic
subject\n* $4 - new topic subject\n* $5 - title for the Flow board\n* $6 -
title for the page that the Flow board is attached
to\n{{Related|Flow-notification}}",
"flow-notification-mention": "{{doc-singularthey}}\nNotification text
for when a user is mentioned in another conversation. Parameters:\n* $1 -
username of the person who made the post, can be used for GENDER\n* $2 -
permalink to the post\n* $3 - title of the topic\n* $4 - title for the page
that the Flow board is attached to\n* $5 - username of the person who receives
the notification, can be used for GENDER\n{{Related|Flow-notification}}",
"flow-notification-link-text-view-post": "Label for button that links
to a flow post.",
diff --git a/includes/Notifications/Formatter.php
b/includes/Notifications/Formatter.php
index f354049..f20f3ba 100644
--- a/includes/Notifications/Formatter.php
+++ b/includes/Notifications/Formatter.php
@@ -39,7 +39,16 @@
$message->params( '' );
}
} elseif ( $param === 'topic-permalink' ) {
- $anchor = $this->getUrlGenerator()->workflowLink(
$event->getTitle(), $extra['topic-workflow'] );
+ // link to individual new-topic
+ $title = isset( $extra['topic-workflow'] )
+ ? Title::newFromText( $extra['topic-workflow'],
NS_TOPIC )
+ : $event->getTitle();
+ $anchor = $this->getUrlGenerator()->workflowLink(
$title, $extra['topic-workflow'] );
+ $anchor->query['fromnotif'] = 1;
+ $message->params( $anchor->getFullUrl() );
+ } elseif ( $param === 'new-topics-permalink' ) {
+ // link to board sorted by newest topics
+ $anchor = $this->getUrlGenerator()->boardLink(
$event->getTitle(), 'newest' );
$anchor->query['fromnotif'] = 1;
$message->params( $anchor->getFullUrl() );
} elseif ( $param == 'flow-title' ) {
diff --git a/includes/Notifications/Notifications.php
b/includes/Notifications/Notifications.php
index 1f8895d..168c5b3 100644
--- a/includes/Notifications/Notifications.php
+++ b/includes/Notifications/Notifications.php
@@ -21,14 +21,14 @@
'destination' => 'flow-new-topics'
),
'title-message' => 'flow-notification-newtopic',
- 'title-params' => array( 'agent', 'flow-title', 'title',
'subject' ),
+ 'title-params' => array( 'agent', 'flow-title', 'title',
'subject', 'topic-permalink' ),
'bundle' => array(
'web' => true,
'email' => true,
),
'bundle-type' => 'event',
'bundle-message' => 'flow-notification-newtopic-bundle',
- 'bundle-params' => array( 'event-count', 'title' ),
+ 'bundle-params' => array( 'event-count', 'title',
'new-topics-permalink' ),
'email-subject-message' =>
'flow-notification-newtopic-email-subject',
'email-subject-params' => array( 'agent', 'title' ),
'email-body-batch-message' =>
'flow-notification-newtopic-email-batch-body',
--
To view, visit https://gerrit.wikimedia.org/r/171005
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2b7b845c0200356fc4297be2be1be2236b275b1e
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits