mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Allow notifiers to know whether we are preparing push notifications
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
e3126fa091
commit
28d8d15a98
2 changed files with 32 additions and 0 deletions
|
|
@ -53,6 +53,9 @@ class Manager implements IManager {
|
|||
/** @var \Closure[] */
|
||||
protected $notifiersInfoClosures;
|
||||
|
||||
/** @var bool */
|
||||
protected $preparingPushNotification;
|
||||
|
||||
/**
|
||||
* Manager constructor.
|
||||
*
|
||||
|
|
@ -66,6 +69,7 @@ class Manager implements IManager {
|
|||
$this->appsClosures = [];
|
||||
$this->notifiersClosures = [];
|
||||
$this->notifiersInfoClosures = [];
|
||||
$this->preparingPushNotification = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -171,6 +175,22 @@ class Manager implements IManager {
|
|||
return !empty($this->notifiersClosures);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $preparingPushNotification
|
||||
* @since 14.0.0
|
||||
*/
|
||||
public function setPreparingPushNotification($preparingPushNotification) {
|
||||
$this->preparingPushNotification = $preparingPushNotification;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @since 14.0.0
|
||||
*/
|
||||
public function isPreparingPushNotification(): bool {
|
||||
return $this->preparingPushNotification;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param INotification $notification
|
||||
* @throws \InvalidArgumentException When the notification is not valid
|
||||
|
|
|
|||
|
|
@ -62,4 +62,16 @@ interface IManager extends IApp, INotifier {
|
|||
* @since 9.0.0
|
||||
*/
|
||||
public function hasNotifiers();
|
||||
|
||||
/**
|
||||
* @param bool $preparingPushNotification
|
||||
* @since 14.0.0
|
||||
*/
|
||||
public function setPreparingPushNotification($preparingPushNotification);
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @since 14.0.0
|
||||
*/
|
||||
public function isPreparingPushNotification();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue