dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
resources: Allow mediawiki.action.edit.editWarning on mobile target
[lhc/web/wiklou.git]
/
includes
/
watcheditem
/
WatchedItemQueryService.php
diff --git
a/includes/watcheditem/WatchedItemQueryService.php
b/includes/watcheditem/WatchedItemQueryService.php
index
95b4cb4
..
3ebc94a
100644
(file)
--- a/
includes/watcheditem/WatchedItemQueryService.php
+++ b/
includes/watcheditem/WatchedItemQueryService.php
@@
-65,14
+65,19
@@
class WatchedItemQueryService {
/** @var ActorMigration */
private $actorMigration;
/** @var ActorMigration */
private $actorMigration;
+ /** @var WatchedItemStoreInterface */
+ private $watchedItemStore;
+
public function __construct(
LoadBalancer $loadBalancer,
CommentStore $commentStore,
public function __construct(
LoadBalancer $loadBalancer,
CommentStore $commentStore,
- ActorMigration $actorMigration
+ ActorMigration $actorMigration,
+ WatchedItemStoreInterface $watchedItemStore
) {
$this->loadBalancer = $loadBalancer;
$this->commentStore = $commentStore;
$this->actorMigration = $actorMigration;
) {
$this->loadBalancer = $loadBalancer;
$this->commentStore = $commentStore;
$this->actorMigration = $actorMigration;
+ $this->watchedItemStore = $watchedItemStore;
}
/**
}
/**
@@
-88,7
+93,6
@@
class WatchedItemQueryService {
/**
* @return IDatabase
/**
* @return IDatabase
- * @throws MWException
*/
private function getConnection() {
return $this->loadBalancer->getConnectionRef( DB_REPLICA, [ 'watchlist' ] );
*/
private function getConnection() {
return $this->loadBalancer->getConnectionRef( DB_REPLICA, [ 'watchlist' ] );
@@
-229,11
+233,14
@@
class WatchedItemQueryService {
break;
}
break;
}
+ $target = new TitleValue( (int)$row->rc_namespace, $row->rc_title );
$items[] = [
new WatchedItem(
$user,
$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 )
];
),
$this->getRecentChangeFieldsFromRow( $row )
];
@@
-308,11
+315,14
@@
class WatchedItemQueryService {
$watchedItems = [];
foreach ( $res as $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,
// 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
+ )
);
}
);
}
@@
-694,7
+704,7
@@
class WatchedItemQueryService {
private function getWatchedItemsWithRCInfoQueryJoinConds( array $options ) {
$joinConds = [
private function getWatchedItemsWithRCInfoQueryJoinConds( array $options ) {
$joinConds = [
- 'watchlist' => [ '
INNER
JOIN',
+ 'watchlist' => [ 'JOIN',
[
'wl_namespace=rc_namespace',
'wl_title=rc_title'
[
'wl_namespace=rc_namespace',
'wl_title=rc_title'