/** @var ActorMigration */
private $actorMigration;
+ /** @var WatchedItemStoreInterface */
+ private $watchedItemStore;
+
public function __construct(
LoadBalancer $loadBalancer,
CommentStore $commentStore,
- ActorMigration $actorMigration
+ ActorMigration $actorMigration,
+ WatchedItemStoreInterface $watchedItemStore
) {
$this->loadBalancer = $loadBalancer;
$this->commentStore = $commentStore;
$this->actorMigration = $actorMigration;
+ $this->watchedItemStore = $watchedItemStore;
}
/**
break;
}
+ $target = new TitleValue( (int)$row->rc_namespace, $row->rc_title );
$items[] = [
new WatchedItem(
$user,
- new TitleValue( (int)$row->rc_namespace, $row->rc_title ),
- $row->wl_notificationtimestamp
+ $target,
+ $this->watchedItemStore->getLatestNotificationTimestamp(
+ $row->wl_notificationtimestamp, $user, $target
+ )
),
$this->getRecentChangeFieldsFromRow( $row )
];
$watchedItems = [];
foreach ( $res as $row ) {
+ $target = new TitleValue( (int)$row->wl_namespace, $row->wl_title );
// todo these could all be cached at some point?
$watchedItems[] = new WatchedItem(
$user,
- new TitleValue( (int)$row->wl_namespace, $row->wl_title ),
- $row->wl_notificationtimestamp
+ $target,
+ $this->watchedItemStore->getLatestNotificationTimestamp(
+ $row->wl_notificationtimestamp, $user, $target
+ )
);
}