Matthias Mullie has submitted this change and it was merged.
Change subject: Fix timestamp of notifications generated by lqt-import
......................................................................
Fix timestamp of notifications generated by lqt-import
Requires Ib9596cc058871a6b27cca7a809efc6b1ca75dfb0
Change-Id: Iabdfc9c52a30717aaa8197b514d55ae758af5f64
---
M includes/Import/Postprocessor/LqtNotifications.php
M includes/Notifications/Controller.php
2 files changed, 13 insertions(+), 7 deletions(-)
Approvals:
Catrope: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/Import/Postprocessor/LqtNotifications.php
b/includes/Import/Postprocessor/LqtNotifications.php
index e6c81b5..408e353 100644
--- a/includes/Import/Postprocessor/LqtNotifications.php
+++ b/includes/Import/Postprocessor/LqtNotifications.php
@@ -135,6 +135,7 @@
'lqtThreadId' => $topic->getLqtThreadId(),
'notifyAgent' => true,
),
+ 'timestamp' => $topic->getTimestamp(),
) );
}
diff --git a/includes/Notifications/Controller.php
b/includes/Notifications/Controller.php
index eb7815b..60a4db5 100644
--- a/includes/Notifications/Controller.php
+++ b/includes/Notifications/Controller.php
@@ -142,15 +142,20 @@
break;
}
- $events = array(
- EchoEvent::create( array(
- 'type' => $eventName,
- 'agent' => $user,
- 'title' => $title,
- 'extra' => $extraData,
- ) ),
+ $info = array(
+ 'type' => $eventName,
+ 'agent' => $user,
+ 'title' => $title,
+ 'extra' => $extraData,
);
+ // Allow a specific timestamp to be set - useful when importing
existing data
+ if ( isset( $data['timestamp'] ) ){
+ $info['timestamp'] = $data['timestamp'];
+ }
+
+ $events = array( EchoEvent::create( $info ) );
+
if ( $newPost ) {
$events = array_merge( $events, $this->notifyNewPost(
$newPost ) );
}
--
To view, visit https://gerrit.wikimedia.org/r/214050
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iabdfc9c52a30717aaa8197b514d55ae758af5f64
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits