Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6cfeb0f7 authored by AVINASH GUSAIN's avatar AVINASH GUSAIN
Browse files

fair use fix

parent 389709f1
Loading
Loading
Loading
Loading
Loading
+21 −10
Original line number Diff line number Diff line
--- ./lib/private/Notification/Manager.php	2022-09-06 21:39:49.735827300 +0530
+++ ./lib/private/Notification/Manager-new.php	2022-10-06 11:09:37.794640100 +0530
@@ -311,10 +311,8 @@
 			 * use of push notifications. If you need this feature, consider using Nextcloud Enterprise.
--- lib/private/Notification/Manager.php	2022-09-06 21:39:49.735827300 +0530
+++ lib/private/Notification/Manager-new.php	2022-10-06 12:29:29.904640100 +0530
@@ -303,21 +303,8 @@
 	 * {@inheritDoc}
 	 */
 			// TODO Remove time check after 1st March 2022
 	public function isFairUseOfFreePushService(): bool {
-		$pushAllowed = $this->cache->get('push_fair_use');
-		if ($pushAllowed === null) {
-			/**
-			 * We want to keep offering our push notification service for free, but large
-			 * users overload our infrastructure. For this reason we have to rate-limit the
-			 * use of push notifications. If you need this feature, consider using Nextcloud Enterprise.
-			 */
-			// TODO Remove time check after 1st March 2022
-			$isFairUse = $this->timeFactory->getTime() < 1646089200
-				|| $this->subscription->delegateHasValidSubscription()
-				|| $this->userManager->countSeenUsers() < 5000;
-			$pushAllowed = $isFairUse ? 'yes' : 'no';
-			$this->cache->set('push_fair_use', $pushAllowed, 3600);
-		}
-		return $pushAllowed === 'yes';
+
+			$pushAllowed = 'yes';
 			$this->cache->set('push_fair_use', $pushAllowed, 3600);
+		return true;
 	}
 		return $pushAllowed === 'yes';

 	/**