27 PageUpdatedEvent::TYPE
38 'class' => self::class,
44 PageUpdatedEvent::TYPE
60 $this->changeTagsStore = $changeTagsStore;
61 $this->userEditTracker = $userEditTracker;
68 $ingress =
new self( $changeTagsStore, $userEditTracker );
69 $ingress->initSubscriber( self::OBJECT_SPEC );
81 && !$event->
hasFlag( PageUpdatedEvent::FLAG_SILENT )
83 $this->updateRecentChangesAfterPageUpdated(
86 $event->
hasFlag( PageUpdatedEvent::FLAG_BOT ),
91 } elseif ( $event->
getTags() ) {
92 $this->updateChangeTagsAfterPageUpdated(
99 && !$event->
hasFlag( PageUpdatedEvent::FLAG_AUTOMATED )
101 $this->updateUserEditTrackerAfterPageUpdated(
107 private function updateChangeTagsAfterPageUpdated( array $tags,
int $revId ) {
108 $this->changeTagsStore->addTags( $tags,
null, $revId );
111 private function updateRecentChangesAfterPageUpdated(
112 RevisionRecord $newRevisionRecord,
113 ?RevisionRecord $oldRevisionRecord,
117 ?EditResult $editResult
120 if ( !$oldRevisionRecord ) {
121 RecentChange::notifyNew(
122 $newRevisionRecord->getTimestamp(),
123 $newRevisionRecord->getPage(),
124 $newRevisionRecord->isMinor(),
125 $newRevisionRecord->getUser( RevisionRecord::RAW ),
126 $newRevisionRecord->getComment( RevisionRecord::RAW )->text,
129 $newRevisionRecord->getSize(),
130 $newRevisionRecord->getId(),
136 RecentChange::notifyEdit(
137 $newRevisionRecord->getTimestamp(),
138 $newRevisionRecord->getPage(),
139 $newRevisionRecord->isMinor(),
140 $newRevisionRecord->getUser( RevisionRecord::RAW ),
141 $newRevisionRecord->getComment( RevisionRecord::RAW )->text,
142 $oldRevisionRecord->getId(),
143 $newRevisionRecord->getTimestamp(),
146 $oldRevisionRecord->getSize(),
147 $newRevisionRecord->getSize(),
148 $newRevisionRecord->getId(),
156 private function updateUserEditTrackerAfterPageUpdated( UserIdentity $author ) {
157 $this->userEditTracker->incrementUserEditCount( $author );