Page MenuHomePhabricator

Introduce TalkPageNotificationManager service
Open, Needs TriagePublic

Description

The following methods should be factored out of the User class, into a new TalkPageNotificationManager service:

  • getNewtalk
  • getNewMessageLinks
  • getNewMessageRevisionId
  • setNewtalk
  • updateNewtalk
  • deleteNewtalk

Event Timeline

daniel renamed this task from Introduce TalkpageNotificationManager service to Introduce TalkPageNotificationManager service.Dec 2 2019, 5:56 PM
daniel created this task.
daniel updated the task description. (Show Details)
tosfos added a subscriber: tosfos.Dec 2 2019, 6:26 PM
CCicalese_WMF removed daniel as the assignee of this task.Dec 16 2019, 6:14 PM
tosfos assigned this task to Vedmaka.Dec 16 2019, 6:24 PM

probably checkNewtalk needs to be factored out too

Probably the TalkPageNotificationManager need to be introduced before the WatchlistNotificationManager (T208777) because as I understand it the User::clearNotification is to be replaced by the WatchlistNotificationManager and the method make use of both User::getNewtalk and User:: setNewtalk so it would make sense to have these already moved to the service

It feels like the User::getTalkPage could be also migrated into a new service, but probably not the TalkPageNotificationManger

The service probably could be drafted like below:

class TalkPageNotificationManager {

    private $userNewTalkCache = [];
    
    public function getNewtalk() { ... }
    public function getNewMessageLinks() { ... }
    public function getNewMessageRevisionId() { ... }
    public function setNewtalk() { ... }
    public function updateNewtalk() { ... }
    public function deleteNewtalk() { ... }
    public function checkNewtalk() { ... }

    public function invalidateCache() { ... }

}